react-component / menu

React Menu
https://menu.react-component.now.sh/
MIT License
681 stars 246 forks source link

Touch Support #76

Open blacktemplar opened 7 years ago

blacktemplar commented 7 years ago

I am using your menu component for a web application which is used on desktops but also on mobile devices. But for devices which only have touch support the menu handling is very counter intuitive und buggy.

One bug would be that sometimes some Submenu-Items are not clickable or they don't open the Submenu. This always happens if a props-change triggers the addition of a new Submenu in which case this Submenu cannot be opened until either another menu item was opened or clicked or you click somewhere else on the menu (I think this is a focus problem).

Furthermore if a submenu is opened it is very buggy and hard to close it again without clicking another menu item and for some browser / mobile versions (I had the problem with an iOS device) its not possible at all (so one submenu must always be open which blocks the main view).

Also in this context it would be good to close a submenu if a menu item got clicked (see #65).

I understand that this component does not focus on touch devices but still will there be an improvement for this devices in near future, or should I use another menu component for touch devices?

benjycui commented 7 years ago

We haven't use rc-menu in mobile devices. If you want it to support touch events, you can create a PR, thanks.

victorpavlenko commented 7 years ago

Hi @blacktemplar are u find a solution?

sabarasaba commented 7 years ago

I actually was in need of this too, would love to see it happen!

blacktemplar commented 7 years ago

Not really, it is usable with touch devices but has a lot of bugs (especially on IPhone). I tried to fix some of them by setting some options, but its still very buggy.

benjycui commented 7 years ago

We don't use this in mobile web, and we are short of hands. But PR is welcomed, thanks.

sunlee-newyork commented 7 years ago

Hi everyone, I figured out a way to bypass by installing the rc-tab-event-plugin, replacing <MenuItem> with <li className="rc-menu-time" onTouchTap={function}> and handle the rc-menu-item-selected class manually with the onTouchTap function by handling the selected keys manually.