Skip to content

Commit 535a2ed

Browse files
committed
fix #1015 MultiSelect Bugged After Removing Options, Refilling And Reselecting Value With Same Key
1 parent 510cfaf commit 535a2ed

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

domino-ui/src/main/java/org/dominokit/domino/ui/forms/suggest/AbstractSelect.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,10 +1240,13 @@ public C removeOption(O option) {
12401240
}
12411241
option.remove();
12421242
optionsMenu.removeItem(found.getMenuItem());
1243+
onOptionRemoved(option);
12431244
});
12441245
return (C) this;
12451246
}
12461247

1248+
protected void onOptionRemoved(O option) {}
1249+
12471250
/**
12481251
* Removes a specified option from the select component.
12491252
*

domino-ui/src/main/java/org/dominokit/domino/ui/forms/suggest/MultiSelect.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,4 +238,9 @@ protected void onTypingStart() {
238238
protected void onTypingEnd() {
239239
this.selectedOptions.forEach(BaseDominoElement::show);
240240
}
241+
242+
@Override
243+
protected void onOptionRemoved(SelectOption<V> option) {
244+
selectedOptions.remove(option);
245+
}
241246
}

0 commit comments

Comments
 (0)