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

Fixes select2 bug from RegEx escaped values #1677

Merged
merged 1 commit into from
Dec 1, 2019
Merged

Conversation

cwisdo
Copy link
Contributor

@cwisdo cwisdo commented Jul 15, 2019

Escaped values are needed for tablesorter filter, but unescaped values should be used in other contexts. (e.g., "a or b", "a/b")

Escaped values are needed for tablesorter filter, but unescaped values should be used in other contexts. (e.g., "a or b", "a/b")
@Mottie
Copy link
Owner

Mottie commented Jul 15, 2019

Hi @cwisdo!

Thanks for your contribution! From my quick look at the code, it doesn't appear to work any differently from before. The variable v is essentially renamed to v_escape. Would you please share a demo and describe how to duplicate the problem you've encountered?

@cwisdo
Copy link
Contributor Author

cwisdo commented Jul 17, 2019

Here is a fiddle which illustrates the problem. If you select A/B in the select2 filter for Name column, it will filter, but will not populate the select2 as a selected value

Here it is with the fix implemented. You can select (and then deselect) A/B

The diff doesn't really show what's going on. The key is in the code that was not changed (i.e., the original v variable is used in the latter context instead of v_escape)

I.e.,

				$cell.find(".select2").select2("val", v);
// update sticky header cell
if (c.widgetOptions.$sticky) {
  c.widgetOptions.$sticky
    .find(".select2col" + indx + " .select2")
    .select2("val", v);
}

@Mottie Mottie merged commit db5a0d5 into Mottie:master Dec 1, 2019
@Mottie
Copy link
Owner

Mottie commented Dec 1, 2019

Thanks again! Sorry for taking so long to get this merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants