Skip to content

Commit

Permalink
fix #959 Single Select Old Value is always null when change listener …
Browse files Browse the repository at this point in the history
…is called
  • Loading branch information
vegegoku committed Sep 19, 2024
1 parent d72cfb4 commit d7e3e4e
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ protected void doSetValue(V value, boolean silent) {
});
}

@Override
protected Select<V> clearValue(boolean silent) {
Select<V> thisSelect = super.clearValue(silent);
this.selectedOption = null;
return thisSelect;
}

protected void doSetOption(SelectOption<V> option) {
if (nonNull(this.selectedOption)) {
this.selectedOption.remove();
Expand Down Expand Up @@ -132,9 +139,6 @@ public Select<V> withOption(SelectOption<V> option, boolean silent) {
protected void onOptionDeselected(SelectOption<V> option, boolean silent) {
option.remove();
option.getComponent().remove();
if (Objects.equals(this.selectedOption, option)) {
this.selectedOption = null;
}
this.optionsMenu.withPauseSelectionListenersToggle(
true,
field -> {
Expand Down

0 comments on commit d7e3e4e

Please sign in to comment.