Skip to content

Commit

Permalink
fix(dropdown): make "set text" work for custom actions
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lubber-de authored Dec 19, 2023
1 parent e123cb8 commit e4ff553
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit e4ff553

Please sign in to comment.