-
-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter indices in bukuserver aren't assigned correctly when modifying filter types (thus changing their order in UI) #624
Comments
…After some checking, it turns out to be the current behaviour of flask-admin. |
Thanks for checking! |
Open
LeXofLeviafan
added a commit
to LeXofLeviafan/buku
that referenced
this issue
Sep 6, 2024
LeXofLeviafan
added a commit
to LeXofLeviafan/buku
that referenced
this issue
Sep 6, 2024
LeXofLeviafan
added a commit
to LeXofLeviafan/buku
that referenced
this issue
Sep 6, 2024
LeXofLeviafan
added a commit
to LeXofLeviafan/buku
that referenced
this issue
Sep 7, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
According to this StackOverflow response (supported by a direct link to the filters parsing code in flask_admin sources):
Meanwhile, in bukuserver these indices are assigned incorrectly (not based on filter row position) when modifying filter types (i.e. by adding/selecting in dropdown).
For example…
For the following filters (indices are reassigned when resubmitting the form/changing the page/etc.)…
Changing the type of the first filter to "tags: not contain" (via the dropdown) resulted in the filter index being set to
4
, which immediately resulted in the following layout:And of course, when the filters are resubmitted (after hitting Enter in a filter field, or clicking on a page link in the pagination panel), the parameters list gets reordered according to indices, and the indices are recalculated to match their resulting positions:
…Considering that the entire point of these indices is to retain the filter ordering (or modify it if needed), the index assigned when changing filter subtype via dropdown should be retained from the previous value, and when a filter is added its index should be based on its position (amount of filter rows at the moment of appending the new one).
The text was updated successfully, but these errors were encountered: