summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorMartin Vysny <martin@vysny.me>2020-12-03 06:16:58 +0200
committerGitHub <noreply@github.com>2020-12-03 06:16:58 +0200
commit1c734ae92dbe03e616ea926c0cc24f6173173450 (patch)
treed8627655808f6f102f5657f61213b7f3ba038349 /client
parent5c839bc6837b90d72561f3a478c0d6089a8f17ba (diff)
downloadvaadin-framework-1c734ae92dbe03e616ea926c0cc24f6173173450.tar.gz
vaadin-framework-1c734ae92dbe03e616ea926c0cc24f6173173450.zip
MenuBar: Don't set openRootOnHover when on Android or IOS. (#12135)
Fixes #5873
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/ui/menubar/MenuBarConnector.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/menubar/MenuBarConnector.java b/client/src/main/java/com/vaadin/client/ui/menubar/MenuBarConnector.java
index f739d16fe4..43f6dcc52d 100644
--- a/client/src/main/java/com/vaadin/client/ui/menubar/MenuBarConnector.java
+++ b/client/src/main/java/com/vaadin/client/ui/menubar/MenuBarConnector.java
@@ -23,6 +23,7 @@ import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.Timer;
import com.vaadin.client.ApplicationConnection;
+import com.vaadin.client.BrowserInfo;
import com.vaadin.client.Paintable;
import com.vaadin.client.TooltipInfo;
import com.vaadin.client.UIDL;
@@ -57,8 +58,14 @@ public class MenuBarConnector extends AbstractComponentConnector
widget.htmlContentAllowed = uidl
.hasAttribute(MenuBarConstants.HTML_CONTENT_ALLOWED);
- widget.openRootOnHover = uidl
- .getBooleanAttribute(MenuBarConstants.OPEN_ROOT_MENU_ON_HOWER);
+ if (BrowserInfo.get().isAndroid() || BrowserInfo.get().isIOS()) {
+ // disable the auto-open on hover on devices that don't support hover.
+ // fixes https://github.com/vaadin/framework/issues/5873
+ widget.openRootOnHover = false;
+ } else {
+ widget.openRootOnHover = uidl
+ .getBooleanAttribute(MenuBarConstants.OPEN_ROOT_MENU_ON_HOWER);
+ }
widget.enabled = isEnabled();