From: Henri Sara Date: Tue, 6 Oct 2009 12:08:20 +0000 (+0000) Subject: #3027 Combobox left in wrong state: handle both mouse and keyboard selection correctly X-Git-Tag: 6.7.0.beta1~2429^2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=077f97fed8a35b462c363ef1247b2035fed1f739;p=vaadin-framework.git #3027 Combobox left in wrong state: handle both mouse and keyboard selection correctly svn changeset:9106/svn branch:6.1 --- diff --git a/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java b/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java index ac042eb899..5e4383a70f 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java @@ -581,6 +581,7 @@ public class VFilterSelect extends Composite implements Paintable, Field, private boolean filtering = false; private boolean selecting = false; + private boolean tabPressed = false; private String lastFilter = ""; private int lastIndex = -1; // last selected index when using arrows @@ -938,6 +939,7 @@ public class VFilterSelect extends Composite implements Paintable, Field, break; case KeyCodes.KEY_TAB: if (suggestionPopup.isAttached()) { + tabPressed = true; filterOptions(currentPage); } // onBlur() takes care of the rest @@ -1047,7 +1049,14 @@ public class VFilterSelect extends Composite implements Paintable, Field, public void onBlur(BlurEvent event) { focused = false; // much of the TAB handling takes place here - suggestionPopup.menu.doSelectedItemAction(); + if (tabPressed) { + tabPressed = false; + suggestionPopup.menu.doSelectedItemAction(); + suggestionPopup.hide(); + } else if (!suggestionPopup.isAttached() + || suggestionPopup.isJustClosed()) { + suggestionPopup.menu.doSelectedItemAction(); + } if (selectedOptionKey == null) { setPromptingOn(); }