]> source.dussan.org Git - vaadin-framework.git/commitdiff
Do not clear combobox text unnecessarily (#10924, #11887)
authorHenri Sara <hesara@vaadin.com>
Tue, 21 May 2013 12:57:18 +0000 (15:57 +0300)
committerHenri Sara <hesara@vaadin.com>
Tue, 21 May 2013 12:57:18 +0000 (15:57 +0300)
Change-Id: Ica66c1d7ca05874ca5a05fb2c9651a6e4758e1d9

client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java

index 345bdc0cbb40b9af7e9b1be3eaaaa5500b240ab8..d9eac91e2b6150768089491078054705bedd9075 100644 (file)
@@ -252,8 +252,11 @@ public class ComboBoxConnector extends AbstractFieldConnector implements
                 getWidget().setPromptingOn();
             } else {
                 // we have focus in field, prompting can't be set on, instead
-                // just clear the input
-                getWidget().tb.setValue("");
+                // just clear the input if the value has changed from something
+                // else to null
+                if (getWidget().selectedOptionKey != null) {
+                    getWidget().tb.setValue("");
+                }
             }
             getWidget().setSelectedItemIcon(null);
             getWidget().selectedOptionKey = null;