Bootstrap-multiselect: Clickable optgroup label doesn't trigger change event

Created on 6 Sep 2016  路  4Comments  路  Source: davidstutz/bootstrap-multiselect

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/

bug

All 4 comments

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

I too have this exact problem.

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

Merged #813.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ingenierotecnico picture ingenierotecnico  路  7Comments

sourav-prescriber-360 picture sourav-prescriber-360  路  8Comments

naxxateux picture naxxateux  路  5Comments

webakimbo picture webakimbo  路  4Comments

Furgas picture Furgas  路  8Comments