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

Update multiselect-dropdown.js #11

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

letheri
Copy link

@letheri letheri commented Nov 14, 2023

Check class from option div's removed when select all clicked.

Check class from option div's removed when select all clicked.
@letheri
Copy link
Author

letheri commented Nov 14, 2023

Fixes the issue #10.

@@ -139,7 +139,7 @@ function MultiselectDropdown(options){

var ch=op.querySelector("input").checked;
list.querySelectorAll(":scope > div:not(.multiselect-dropdown-all-selector)")
.forEach(i=>{if(i.style.display!=='none'){i.querySelector("input").checked=ch; i.optEl.selected=ch}});
.forEach(i=>{if(i.style.display!=='none'){i.querySelector("input").checked=ch; i.classList.remove('checked'); i.optEl.selected=ch}});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not always remove the class, but .toggle('checked', ch) I believe.

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