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

checkbox text filter weird results #326

Open
Timo-Breumelhof opened this issue May 30, 2024 · 0 comments
Open

checkbox text filter weird results #326

Timo-Breumelhof opened this issue May 30, 2024 · 0 comments

Comments

@Timo-Breumelhof
Copy link

Timo-Breumelhof commented May 30, 2024

Yes, I know this will not be fixed, I'm just logging this so someone else with this issue does not "burn" 2.5 hours of debugging like I did..
On an existing project with this version of jpList I noticed that the filter results using the Checkbox-text-filter were incorrect.
After a lot of testing I found that the results are incorrect when the value contains a hyphen (-)

This does not work correctly:

```
<div
	   class="jplist-group"
	   data-control-type="checkbox-text-filter"
	   data-control-action="filter"
	   data-control-name="keywords"
	   data-path=".keywords"
	   data-logic="or">


	<input
		  value="nature"
		  id="nature"
		  type="checkbox"
	   />

	   <label for="nature">Nature</label>

	   <input
		  value="grade-2"
		  id="grade-2"
		  type="checkbox"
	   />

	   <label for="lifestyle">Grade-2</label>
	</div>

This does:

		```
<div
		   class="jplist-group"
		   data-control-type="checkbox-text-filter"
		   data-control-action="filter"
		   data-control-name="keywords"
		   data-path=".keywords"
		   data-logic="or">


		<input
			  value="nature"
			  id="nature"
			  type="checkbox"
		   />

		   <label for="nature">Nature</label>

		   <input
			  value="grade_2"
			  id="grade-2"
			  type="checkbox"
		   />

		   <label for="lifestyle">Grade-2</label>
		</div>

So I simply replaced the - with _ (is an option in my use case) and the filtering worked correctly

@Timo-Breumelhof Timo-Breumelhof changed the title checkbox text filter wird results checkbox text filter weird results May 30, 2024
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

No branches or pull requests

1 participant