bootstrap-table
bootstrap-table copied to clipboard
[cookie] Cookie extension not resetting selected page when searching
Bootstraptable version(s) affected
1.21.0
Description
When using the cookie extension to remember table state, when searching the current page is not reset to the fist page.
Steps to reproduce:
- https://live.bootstrap-table.com/code/marceloverdijk/12863
- Go to page 2
- Search for value
1
- Expected result: Page 1 to be shown automatically
- Actual result: Page 2 still active
Example(s)
https://live.bootstrap-table.com/code/marceloverdijk/12863
Possible Solutions
No response
Additional Context
No response
I guess we don't change the page because if you remove the search you are back to the page you are started on. But for me it would be fine to reset the page.
It's similar to #6402. @wenzhixin @djhvscf What do you think ?
From an UI perspective I think resetting the page to 1 makes sense. Even when just developing I find myself many times navigating the table (e.g. to page 3), then searching (or adapting search) and then not seeing the expected result directly. Just because I'm still on page 3 😬
The example is not working for me at all. But I think we shouldn't reset the page.
Hi Dennis ,
What is the problem you are noticing with the example? For me it works 🤷♂️
About resetting the page. What is your reasoning to not reset it to page 1 after searching?
Note , without cookie extension the page is reset to page 1 when searching, so why should this not happen when using cookie extension? (I'm missing the use case?)
It is now annoying when eg searching for "Mi" and you don't see expected result on page 1 . You go to page 2 and think "o still to many result and you adapt search to "Mic". Because page not reset to page 1 (only when using cookie) you miss the result from page 1. Same with Google or many other search , after adapting search you normally want to check again from the beginning , not on the page you were before.
But if you think it's better to introduce a config option for this , that would be fine for me to (and I can update related PRs). Any name suggestion for such a config option ?
@djhvscf The example also works fine for me. Could you please also explain why we should not reset the page ?
Hi @djhvscf , are you still having problems with the example?
@wenzhixin what do you think about this ?