From 0f052d4fcb5eabccfaae5a2e486c38cb5eabc08d Mon Sep 17 00:00:00 2001 From: Anna Koskinen Date: Fri, 23 Mar 2018 15:09:10 +0200 Subject: Fix VComboBox internal state cleanup (#10693) Fixes vaadin/testbench#1009 --- client/src/main/java/com/vaadin/client/ui/VComboBox.java | 5 +++-- .../main/java/com/vaadin/client/ui/combobox/ComboBoxConnector.java | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'client') diff --git a/client/src/main/java/com/vaadin/client/ui/VComboBox.java b/client/src/main/java/com/vaadin/client/ui/VComboBox.java index 863b56decc..d67615d4b2 100644 --- a/client/src/main/java/com/vaadin/client/ui/VComboBox.java +++ b/client/src/main/java/com/vaadin/client/ui/VComboBox.java @@ -257,12 +257,12 @@ public class VComboBox extends Composite implements Field, KeyDownHandler, return $entry(function(e) { var deltaX = e.deltaX ? e.deltaX : -0.5*e.wheelDeltaX; var deltaY = e.deltaY ? e.deltaY : -0.5*e.wheelDeltaY; - + // IE8 has only delta y if (isNaN(deltaY)) { deltaY = -0.5*e.wheelDelta; } - + @com.vaadin.client.ui.VComboBox.JsniUtil::moveScrollFromEvent(*)(widget, deltaX, deltaY, e, e.deltaMode); }); }-*/; @@ -1561,6 +1561,7 @@ public class VComboBox extends Composite implements Field, KeyDownHandler, */ private void cancelPendingPostFiltering() { pendingUserInput = null; + waitingForFilteringResponse = false; } /** 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 21b4c0b02f..8178640900 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 @@ -130,6 +130,11 @@ public class ComboBoxConnector extends AbstractListingConnector getWidget().selectedOptionKey = null; getWidget().currentSuggestion = null; } + if (isNewItemStillPending() + && pendingNewItemValue == getState().selectedItemCaption) { + // no automated selection handling required + clearNewItemHandling(); + } getDataReceivedHandler().updateSelectionFromServer( getState().selectedItemKey, getState().selectedItemCaption, getState().selectedItemIcon); -- cgit v1.2.3