From 7a6a6145df0f8a997287e406d50cab7fd6b0d994 Mon Sep 17 00:00:00 2001 From: jakeb16 Date: Mon, 23 May 2022 13:47:45 -0700 Subject: [PATCH] Fixes Big with Both Unique and Chosen plugins There is a issue where the chosen control is not getting updated after you disable options. Example is here https://codepen.io/jakeb16/pen/bGLRjPQ This fixes the problem. --- src/plugins/unique-filter/plugin.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/unique-filter/plugin.js b/src/plugins/unique-filter/plugin.js index 5b6fb802..500a936c 100644 --- a/src/plugins/unique-filter/plugin.js +++ b/src/plugins/unique-filter/plugin.js @@ -110,5 +110,8 @@ QueryBuilder.extend(/** @lends module:plugins.UniqueFilter.prototype */ { if (self.settings.plugins && self.settings.plugins['bt-selectpicker']) { self.$el.find(QueryBuilder.selectors.rule_filter).selectpicker('render'); } + else if (self.settings.plugins && self.settings.plugins['chosen-selectpicker']) { + self.$el.find(QueryBuilder.selectors.rule_filter).trigger('chosen:updated'); + } } });