Skip to content

Commit b958ff9

Browse files
committed
adapt unselectOption to support selectMultipleWithCtrl
1 parent 653b02c commit b958ff9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

web/dropdown.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ class Dropdown {
172172
*/
173173
public unselectOption(value: string) {
174174
const optionIndex = this.options.findIndex((option) => value === option.value);
175-
if (this.multipleAllowed && optionIndex > -1 && (this.optionsSelected[0] || this.optionsSelected[optionIndex])) {
175+
if (optionIndex < 0 && (this.optionsSelected[0] || this.optionsSelected[optionIndex])) return;
176+
if (this.multipleAllowed || this.selectMultipleWithCtrl) {
176177
if (this.optionsSelected[0]) {
177178
// Show All is currently selected, so unselect it, and select all branch options
178179
this.optionsSelected[0] = false;

0 commit comments

Comments
 (0)