-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: force refreshValue to update input value on the client-side #3712
fix: force refreshValue to update input value on the client-side #3712
Conversation
adb5471
to
f4b174c
Compare
@@ -325,7 +329,7 @@ protected void refreshValue() { | |||
getDataGenerator().generateData(value, json); | |||
getElement().setPropertyJson(PROP_SELECTED_ITEM, json); | |||
getElement().setProperty(PROP_VALUE, keyMapper.key(value)); | |||
getElement().setProperty(PROP_INPUT_ELEMENT_VALUE, | |||
getElement().executeJs("this._inputElementValue = $0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: I added this change more for the sake of consistency. It doesn't matter for the fix.
SonarCloud Quality Gate failed. 0 Bugs No Coverage information |
Hi @vursen and @vursen, when i performed cherry-pick to this commit to 23.2, i have encountered the following issue. Can you take a look and pick it manually? |
Hi @vursen and @vursen, when i performed cherry-pick to this commit to 23.1, i have encountered the following issue. Can you take a look and pick it manually? |
Hi @vursen and @vursen, when i performed cherry-pick to this commit to 14.8, i have encountered the following issue. Can you take a look and pick it manually? |
This ticket/PR has been released with Vaadin 23.3.0.alpha1 and is also targeting the upcoming stable 23.3.0 version. |
Description
The earlier fix by @sissbruecker doesn't cover the case when ComboBox is cleared in the same round-trip as a custom value is set, e.g when calling
comboBox.clear()
in acustomValueSet
listener.The issue manifests when trying to set a custom value on a combo-box without value. In that case, the internal
customValueSet
listener does have effect, setting_inputElementValue
from an empty value to the custom value. However, since ComboBox is immediately cleared, it comes out like nothing has changed for the server in the end:_inputElementValue
remains empty as it was, although it is not empty on the client-side.This PR changes
refreshValue()
to force_inputElementValue
client-side update by using theexecuteJs
API.Depends on
Fixes #1090
Type of change
Checklist