Skip to content

Commit

Permalink
fix #940 SuggestBox clearValue(...) does not clear value if it isnt p…
Browse files Browse the repository at this point in the history
…redefined choice
  • Loading branch information
vegegoku committed Jul 26, 2024
1 parent 28250c8 commit 896c9de
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ protected SuggestBox<V, E, O> clearValue(boolean silent) {
onOptionDeselected(selectedOption);
getInputElement().element().value = null;
});

if (!silent) {
triggerClearListeners(oldValue);
triggerChangeListeners(oldValue, getValue());
Expand All @@ -197,6 +196,8 @@ protected SuggestBox<V, E, O> clearValue(boolean silent) {
if (isAutoValidation()) {
autoValidate();
}
} else {
withPauseChangeListenersToggle(true, field -> getInputElement().element().value = null);
}

return this;
Expand All @@ -212,7 +213,7 @@ public String getStringValue() {
if (nonNull(this.selectedOption)) {
return String.valueOf(this.selectedOption.getValue());
}
return null;
return getInputElement().element().value;
}

/** Handles actions to be performed after an option is selected. */
Expand Down

0 comments on commit 896c9de

Please sign in to comment.