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

Clickable optgroup label doesn't trigger change event #799

Closed
CodeBrauer opened this issue Sep 6, 2016 · 4 comments
Closed

Clickable optgroup label doesn't trigger change event #799

CodeBrauer opened this issue Sep 6, 2016 · 4 comments
Labels

Comments

@CodeBrauer
Copy link

CodeBrauer commented Sep 6, 2016

Using enableClickableOptGroups: true on a multiple select works fine. But clicking an optgroup-label will not trigger an "change" event on the select.

So the value(s) of the <select> changes but no event listener will detect this change.

screenshot gif

Demo of this issue on https://jsfiddle.net/85pbc12a/1/

I created a very quick and dirty fix:

$('.multiselect-group-clickable').bind('click', function() {
  // not the best way to find the select...
  $(this).parentsUntil('.btn-group').parent().parent().find('select').trigger('change');
}

Demo "fixed" version: https://jsfiddle.net/36jw8cdm/1/

@CodeBrauer
Copy link
Author

CodeBrauer commented Sep 6, 2016

Maybe this would be just a small change, but no time currently to test this.

Just include this line: $(element).trigger('change'); in updateOptGroups
Check out the pull request #813

@john-clarke
Copy link

I too have this exact problem.

@davidstutz
Copy link
Owner

Will have a look at the PR, this should get fixed.

davidstutz added a commit that referenced this issue Dec 17, 2017
@davidstutz
Copy link
Owner

Merged #813.

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

Successfully merging a pull request may close this issue.

3 participants