p-table with save state (localstorage/sessionstorage) remember old value after delete from filter #10065
Labels
LTS-FIXED-9.2.6
Fixed in PrimeNG LTS 9.2.6
LTS-FIXED-10.1.1
Fixed in PrimeNG LTS 10.1.1
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
I'm submitting a ... (check one with "x")
Plunkr Case (Bug Reports)
Please demonstrate your case at stackblitz by using the issue template below. Issues without a test case have much less possibility to be reviewd in detail and assisted.
https://stackblitz.com/edit/primeng-tablestate-demo-uckb6g?file=src%2Fapp%2Fapp.component.html
Current behavior
If user type in filters some text, then deletes it in localstorage/sessionstorage text from filter it still alive. I see that issue exist when p-table doesn't have [paginator]="true". When p-table have [paginator]="true" state working fine.
Expected behavior
When p-table don't have [paginator]="true" and user delete text from filter then should be delete from storage.
Minimal reproduction of the problem with instructions
On section case i paste url with the bug. Be on page press F12 and go to section 'application' -> 'localstorage' -> url stackblitz, and on stackblitz put some text on filter you will see value of filter save in storage. If you remove all characters from filter then in storage will have old value. If you in p-table add '[paginator]="true"' and do same steps, the value from storage will deletes.
What is the motivation / use case for changing the behavior?
I use in production app custom paginator, and after refresh page filters will fill with old value. To remove value user must have clear application storage.
Angular version: 11.0.8
PrimeNG version: 11.2.3
Browser: all
The text was updated successfully, but these errors were encountered: