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

Select2 filter seems to be broken #1497

Closed
robinbrisa opened this issue Jan 18, 2018 · 10 comments
Closed

Select2 filter seems to be broken #1497

robinbrisa opened this issue Jan 18, 2018 · 10 comments

Comments

@robinbrisa
Copy link

The select2 filter is broken. Selected values are not being filtered.
The bug is even there on the demo : https://mottie.github.io/tablesorter/docs/example-widget-filter-formatter-select2.html

@Mottie
Copy link
Owner

Mottie commented Jan 18, 2018

Hi @robinbrisa!

Thanks for reporting this problem!

@macsupport
Copy link

The issue seems to be if the selection contains 2 words instead of 1 ( See AlphaNumeric (exact; only available) in the demo), it filters but the selection does not show in the search box. In the first column, AlphaNumeric (match), choose "abc" and it shows in the select2 input, select "abc 1" in the second column and it is not displayed but the filter still works.

@FlorianChretien
Copy link

@Mottie Hello, we still have the same problem. Thanks for your help !

@Mottie
Copy link
Owner

Mottie commented Mar 13, 2019

Hi @FlorianChretien!

Please elaborate on the issue you're having. A demo showing the problem would be appreciated.

@FlorianChretien
Copy link

As said above, if there is a space between words, nothing is displayed. We can also see it in the demo (2nd column) : https://mottie.github.io/tablesorter/docs/example-widget-filter-formatter-select2.html

@Mottie
Copy link
Owner

Mottie commented Mar 14, 2019

Ahh, ok... I'll look into this on the weekend.

@Mottie Mottie reopened this Mar 14, 2019
@FlorianChretien
Copy link

Thanks :D

@sthkn
Copy link

sthkn commented Mar 15, 2019

I commented in the Slack, but I'll put it here so other's can find it.

The issue resides on line 68 here https://github.com/Mottie/tablesorter/blob/master/js/widgets/widget-filter-formatter-select2.js.

If you remove the \s from the regex, the selected options with a space will work.
Additionally, some of the other special characters in the regex may cause issues depending on the data.

For example, I have a table that lists computer names, organizational units, and some other details about a computer. The computer names have a '-' in them, and OUs have a /, both were being picked up by the regex mentioned and prevented them from visually being selected. Hope this helps!

@Mottie
Copy link
Owner

Mottie commented Mar 16, 2019

Thanks @sthkn!

Maybe adding an option for this regexp would be the best solution.

Mottie added a commit that referenced this issue Jul 11, 2019
@Mottie
Copy link
Owner

Mottie commented Dec 1, 2019

Sorry for the super-long delay! Version 2.31.2 is now available.

@Mottie Mottie closed this as completed Dec 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants