Skip to content
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

Table Filter-Select doesn't select the active option #744

Closed
lcharette opened this issue Jun 26, 2017 · 3 comments
Closed

Table Filter-Select doesn't select the active option #744

lcharette opened this issue Jun 26, 2017 · 3 comments
Labels
confirmed bug Something isn't working frontend The frontend interface

Comments

@lcharette
Copy link
Member

When visiting a page with a table sorter instance (without any hash already defined in the url, a link for example), the active state won't be applied the filter-select (the select itself). The table filter is still set.

It should work when reloading the page.

This was fixed in 4.1, but caused another bug (See #688 and commit 5b77d54).

Basically, when adding the select option from the API (here), it also need to apply the active state. Previous option was to refresh the filters, but that caused issue #688.

When reloading the page, it shouldn't be an issue since sort2hash apply a timeout (To it apply the filter after the select is created).

@alexweissman alexweissman added confirmed bug Something isn't working frontend The frontend interface labels Jun 26, 2017
@alexweissman
Copy link
Member

Seems like the solution to this would be:

  1. After the select options are generated (after buildSelect is called), determine the current filter value for that column;
  2. Locate the select control using .tablesorter-filter[data-column='{columnNumber}'] or something similar;
  3. Set the active option based on the current filter value.

alexweissman added a commit that referenced this issue Jul 15, 2017
@alexweissman
Copy link
Member

Ok, I've pushed a potential fix to hotfix. Can you try it out and make sure it doesn't break anything?

@alexweissman
Copy link
Member

Alright, fixed in 4.1.5 (81bf822).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed bug Something isn't working frontend The frontend interface
Projects
None yet
Development

No branches or pull requests

2 participants