From 07242df096b709c960d2380e9e13c42ba8fb912a Mon Sep 17 00:00:00 2001 From: EDV4 EDV4 Date: Wed, 18 Jul 2018 11:06:37 +0200 Subject: [PATCH] Knockout SelectedOptions not set when onChange fires #930 --- dist/js/bootstrap-multiselect.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/dist/js/bootstrap-multiselect.js b/dist/js/bootstrap-multiselect.js index 2a028b77..52fd6052 100644 --- a/dist/js/bootstrap-multiselect.js +++ b/dist/js/bootstrap-multiselect.js @@ -608,6 +608,9 @@ else { this.deselectAll(this.options.selectAllJustVisible, true); } + + this.$select.change(); + this.updateButtonText(); } else { if (checked) { @@ -639,20 +642,20 @@ $option.prop('selected', false); } - // To prevent select all from firing onChange: #575 - this.options.onChange($option, checked); - // Do not update select all or optgroups on select all change! this.updateSelectAll(); if (this.options.enableClickableOptGroups && this.options.multiple) { this.updateOptGroups(); } + + this.$select.change(); + this.updateButtonText(); + + // To prevent select all from firing onChange: #575 + this.options.onChange($option, checked); } - this.$select.change(); - this.updateButtonText(); - if(this.options.preventInputChangeEvent) { return false; }