diff options
author | Anna Miroshnik <anna.miroshnik@arcadia.spb.ru> | 2014-10-30 14:30:48 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2016-11-04 13:51:41 +0000 |
commit | 0652f2abb8bcdbfa76ec135025284115bcb71e2f (patch) | |
tree | 02b22f37524a5118d19fa0f4932167e2b12f1807 /client | |
parent | c1a027bc699a9c7fa52c534d34ef2f5a4e455633 (diff) | |
download | vaadin-framework-0652f2abb8bcdbfa76ec135025284115bcb71e2f.tar.gz vaadin-framework-0652f2abb8bcdbfa76ec135025284115bcb71e2f.zip |
Scrolling down submenus via scrollbar (MenuBar.isAutoOpen()) (#10456)
full name of defect: Can't scroll down submenus using the scrollbar when
MenuBar.isAutoOpen() == true
Tests.
Change-Id: I2cbe797c96dc6a780df147e165babb23f7fbdef3
Diffstat (limited to 'client')
-rw-r--r-- | client/src/main/java/com/vaadin/client/ui/VMenuBar.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/VMenuBar.java b/client/src/main/java/com/vaadin/client/ui/VMenuBar.java index d08301ec93..2f1b93994b 100644 --- a/client/src/main/java/com/vaadin/client/ui/VMenuBar.java +++ b/client/src/main/java/com/vaadin/client/ui/VMenuBar.java @@ -33,6 +33,10 @@ import com.google.gwt.event.dom.client.KeyDownEvent; import com.google.gwt.event.dom.client.KeyDownHandler; import com.google.gwt.event.dom.client.KeyPressEvent; import com.google.gwt.event.dom.client.KeyPressHandler; +import com.google.gwt.event.dom.client.MouseOutEvent; +import com.google.gwt.event.dom.client.MouseOutHandler; +import com.google.gwt.event.dom.client.MouseOverEvent; +import com.google.gwt.event.dom.client.MouseOverHandler; import com.google.gwt.event.logical.shared.CloseEvent; import com.google.gwt.event.logical.shared.CloseHandler; import com.google.gwt.user.client.Command; @@ -54,7 +58,7 @@ import com.vaadin.shared.ui.menubar.MenuBarConstants; public class VMenuBar extends SimpleFocusablePanel implements CloseHandler<PopupPanel>, KeyPressHandler, KeyDownHandler, - FocusHandler, SubPartAware { + FocusHandler, SubPartAware, MouseOutHandler, MouseOverHandler { // The hierarchy of VMenuBar is a bit weird as VMenuBar is the Paintable, // used for the root menu but also used for the sub menus. @@ -605,6 +609,8 @@ public class VMenuBar extends SimpleFocusablePanel popup.setWidget(item.getSubMenu()); popup.addCloseHandler(this); popup.addAutoHidePartner(item.getElement()); + popup.addDomHandler(this, MouseOutEvent.getType()); + popup.addDomHandler(this, MouseOverEvent.getType()); // at 0,0 because otherwise IE7 add extra scrollbars (#5547) popup.setPopupPosition(0, 0); @@ -1718,4 +1724,14 @@ public class VMenuBar extends SimpleFocusablePanel public CustomMenuItem getMenuItemWithElement(Element element) { return getMenuItemWithElement(DOM.asOld(element)); } + + @Override + public void onMouseOver(MouseOverEvent event) { + LazyCloser.cancelClosing(); + } + + @Override + public void onMouseOut(MouseOutEvent event) { + LazyCloser.schedule(); + } } |