aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorSun Zhe <31067185+ZheSun88@users.noreply.github.com>2018-11-27 14:59:17 +0200
committerGitHub <noreply@github.com>2018-11-27 14:59:17 +0200
commit8d171648e51d8fcf045643df2d7b431ba8ac9ba0 (patch)
treee9d9ce01ec7cc58b544c74fffd49a4546eb61bc1 /client
parent2f72ac663f9eb03028d12324055b54e893fe3cf5 (diff)
downloadvaadin-framework-8d171648e51d8fcf045643df2d7b431ba8ac9ba0.tar.gz
vaadin-framework-8d171648e51d8fcf045643df2d7b431ba8ac9ba0.zip
Revert "Update ComboBox internal state on new item added (#11094)" (#11331)
* Revert "Update ComboBox internal state on new item added (#11094)" This reverts commit 56ce91c6160a252ddcd952bca6eb7037120ebf59. * Add tests to verify the issue
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/ui/VComboBox.java35
1 files changed, 10 insertions, 25 deletions
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 a8ab05770e..f80927ec1d 100644
--- a/client/src/main/java/com/vaadin/client/ui/VComboBox.java
+++ b/client/src/main/java/com/vaadin/client/ui/VComboBox.java
@@ -16,6 +16,16 @@
package com.vaadin.client.ui;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Locale;
+import java.util.Set;
+import java.util.UUID;
+import java.util.logging.Logger;
+
import com.google.gwt.animation.client.AnimationScheduler;
import com.google.gwt.aria.client.Roles;
import com.google.gwt.core.client.JavaScriptObject;
@@ -75,15 +85,6 @@ import com.vaadin.shared.AbstractComponentState;
import com.vaadin.shared.ui.ComponentStateUtil;
import com.vaadin.shared.util.SharedUtil;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Locale;
-import java.util.Set;
-import java.util.logging.Logger;
-
/**
* Client side implementation of the ComboBox component.
*
@@ -1635,11 +1636,6 @@ public class VComboBox extends Composite implements Field, KeyDownHandler,
performSelection(selectedKey, oldSuggestionTextMatchTheOldSelection,
!isWaitingForFilteringResponse() || popupOpenerClicked);
- // currentSuggestion should be set to match the value of the
- // ComboBox, especially when a new item is added.
- resetCurrentSuggestionIfNecessary(selectedKey, selectedCaption,
- selectedIconUri);
-
cancelPendingPostFiltering();
setSelectedCaption(selectedCaption);
@@ -1647,16 +1643,6 @@ public class VComboBox extends Composite implements Field, KeyDownHandler,
setSelectedItemIcon(selectedIconUri);
}
- private void resetCurrentSuggestionIfNecessary(String selectedKey,
- String selectedCaption, String selectedIconUri) {
- if (currentSuggestion == null
- && (selectedKey != null || selectedCaption != null))
- currentSuggestion = new ComboBoxSuggestion(selectedKey,
- selectedCaption, "", selectedIconUri);
- else if (selectedKey == null && selectedCaption == null)
- currentSuggestion = null;
- }
-
}
// TODO decide whether this should change - affects themes and v7
@@ -2124,7 +2110,6 @@ public class VComboBox extends Composite implements Field, KeyDownHandler,
currentSuggestion = null; // #13217
selectedOptionKey = null;
setText(getEmptySelectionCaption());
- return;
}
// some item selected
for (ComboBoxSuggestion suggestion : currentSuggestions) {