From e4ff5533efb6b3cd06a40ba1ad96ebe46260b4a7 Mon Sep 17 00:00:00 2001 From: Marco 'Lubber' Wienkoop Date: Tue, 19 Dec 2023 19:28:45 +0100 Subject: [PATCH] fix(dropdown): make "set text" work for custom actions The set text behavior was not working for custom actions whereas such function internally calls the "set text" method. This PR also fixes showing all items before hiding when a non-multiple dropdown allowed additions --- src/definitions/modules/dropdown.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/definitions/modules/dropdown.js b/src/definitions/modules/dropdown.js index 5c0576f7a4..81a58a46ce 100644 --- a/src/definitions/modules/dropdown.js +++ b/src/definitions/modules/dropdown.js @@ -1413,7 +1413,9 @@ module.remove.userAddition(); } if (!settings.keepSearchTerm) { - module.remove.filteredItem(); + if (module.is.multiple()) { + module.remove.filteredItem(); + } module.remove.searchTerm(); } if (!module.is.visible() && $target.length > 0) { @@ -2587,7 +2589,7 @@ } else { $combo.text(text); } - } else if (settings.action === 'activate') { + } else if (settings.action === 'activate' || isFunction(settings.action)) { if (text !== module.get.placeholderText() || isNotPlaceholder) { $text.removeClass(className.placeholder); }