From ead24c18282f793231c4ef5015851731693153a8 Mon Sep 17 00:00:00 2001 From: Anna Koskinen Date: Thu, 8 Mar 2018 14:04:54 +0200 Subject: Clear VComboBox selection fields when updated on server (#10692) Fixes #10660 --- .../main/java/com/vaadin/client/ui/combobox/ComboBoxConnector.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'client') diff --git a/client/src/main/java/com/vaadin/client/ui/combobox/ComboBoxConnector.java b/client/src/main/java/com/vaadin/client/ui/combobox/ComboBoxConnector.java index 544f041770..21b4c0b02f 100644 --- a/client/src/main/java/com/vaadin/client/ui/combobox/ComboBoxConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/combobox/ComboBoxConnector.java @@ -126,6 +126,10 @@ public class ComboBoxConnector extends AbstractListingConnector @OnStateChange({ "selectedItemKey", "selectedItemCaption", "selectedItemIcon" }) private void onSelectionChange() { + if (getWidget().selectedOptionKey != getState().selectedItemKey) { + getWidget().selectedOptionKey = null; + getWidget().currentSuggestion = null; + } getDataReceivedHandler().updateSelectionFromServer( getState().selectedItemKey, getState().selectedItemCaption, getState().selectedItemIcon); -- cgit v1.2.3