diff options
author | Artur Signell <artur.signell@itmill.com> | 2011-03-31 07:21:42 +0000 |
---|---|---|
committer | Artur Signell <artur.signell@itmill.com> | 2011-03-31 07:21:42 +0000 |
commit | 6b1b62c7bedc5fc6cc08c511e3be5bec343faf87 (patch) | |
tree | e28765e5e6410db1e42eff190a20e5fc6943b8ca /src | |
parent | aafbf7ae12313bba3ffee974e68724c0993fb738 (diff) | |
download | vaadin-framework-6b1b62c7bedc5fc6cc08c511e3be5bec343faf87.tar.gz vaadin-framework-6b1b62c7bedc5fc6cc08c511e3be5bec343faf87.zip |
#6686 Prevent events for the ComboBox popup to propagate to avoid triggering shortcut events and similar
svn changeset:18044/svn branch:6.6
Diffstat (limited to 'src')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java b/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java index 933f2880e9..68d5e40326 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java @@ -1274,30 +1274,36 @@ public class VFilterSelect extends Composite implements Paintable, Field, } /** - * Triggered when a key was pressed in the suggestion popup + * Triggered when a key was pressed in the suggestion popup. * * @param event * The KeyDownEvent of the key */ private void popupKeyDown(KeyDownEvent event) { + // Propagation of handled events is stopped so other handlers such as + // shortcut key handlers do not also handle the same events. switch (event.getNativeKeyCode()) { case KeyCodes.KEY_DOWN: suggestionPopup.selectNextItem(); DOM.eventPreventDefault(DOM.eventGetCurrentEvent()); + event.stopPropagation(); break; case KeyCodes.KEY_UP: suggestionPopup.selectPrevItem(); DOM.eventPreventDefault(DOM.eventGetCurrentEvent()); + event.stopPropagation(); break; case KeyCodes.KEY_PAGEDOWN: if (hasNextPage()) { filterOptions(currentPage + 1, lastFilter); } + event.stopPropagation(); break; case KeyCodes.KEY_PAGEUP: if (currentPage > 0) { filterOptions(currentPage - 1, lastFilter); } + event.stopPropagation(); break; case KeyCodes.KEY_TAB: if (suggestionPopup.isAttached()) { @@ -1316,6 +1322,8 @@ public class VFilterSelect extends Composite implements Paintable, Field, .get(0)); } suggestionPopup.menu.doSelectedItemAction(); + + event.stopPropagation(); break; } |