diff options
author | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2017-07-17 14:08:30 +0300 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-07-17 14:08:30 +0300 |
commit | 01a453649e1c4ace5ea1e2b8dcf18102a639d0f1 (patch) | |
tree | 62121fcbb1f3627801286876f778fec36f9173b4 /client | |
parent | 6c61a9797ce364cc706eb468605512b7d6d537cd (diff) | |
download | vaadin-framework-01a453649e1c4ace5ea1e2b8dcf18102a639d0f1.tar.gz vaadin-framework-01a453649e1c4ace5ea1e2b8dcf18102a639d0f1.zip |
Fix combobox adding new items on blur (#9660)
Fixes #9071
Diffstat (limited to 'client')
-rw-r--r-- | client/src/main/java/com/vaadin/client/ui/VComboBox.java | 12 |
1 files changed, 10 insertions, 2 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 45e69cee01..61e9b46e68 100644 --- a/client/src/main/java/com/vaadin/client/ui/VComboBox.java +++ b/client/src/main/java/com/vaadin/client/ui/VComboBox.java @@ -2489,11 +2489,19 @@ public class VComboBox extends Composite implements Field, KeyDownHandler, focused = false; updatePlaceholder(); + removeStyleDependentName("focus"); + + // Send new items when clicking out with the mouse. if (!readonly) { - reset(); + if (textInputEnabled && allowNewItems + && (currentSuggestion == null || tb.getText().equals( + currentSuggestion.getReplacementString()))) { + dataReceivedHandler.reactOnInputWhenReady(tb.getText()); + } else { + reset(); + } suggestionPopup.hide(); } - removeStyleDependentName("focus"); connector.sendBlurEvent(); } |