-
-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dropdown] cannot use mouse on iPad #1989
Comments
My same guess as for slider: The module checks for a touchdevice (which the ipad still is) and either binds touch or mouse events. As the mouse events are not bound, the mouse is not triggering the necessary events. |
Just as for #1988, the issue is caused by the distinction between touch and non-touch devices (see dropdown.js, line 702): On touch devices, only (!) touch events are handled, on non-touch devices (only) mouse events are handled. Again, IMHO, the trivial solution would be removing this whole distinction and all the touch event binding code. However, I learned from the Git history, that the distinction is required to mitigate some missing click events on iOS (#647, #1220), which seem to originate from strange behaviour in the mouse emulation of iOS Safari (see this StackOverflow thread: https://stackoverflow.com/questions/24077725/mobile-safari-sometimes-does-not-trigger-the-click-event). If the iOS issue in #647 could be fixed with one of the other workarounds, mentioned there, it would be possible to remove the special handling of touch events, as suggested above. Otherwise, I would suggest always binding to both, mouse and touch events, and adding |
Instead of distinguishing between touch and non-touch devices and binding to different events, we always bind to mouse events. For touch input, we mostly rely on the mouse event emulation (esp. click and mouseenter events) of modern browsers. This fixes fomantic#1989
This PR fixes #1989 in a similar way as my previous PR for the slider (#2327): First, I removed all special event handling for touch events and the whole distiction between touch- and non-touch devices, so mouse events will be handled on touch devices as well. Then, I added only a few touch event bindings for the things that don't work via mouse event emulation of the mobile web browsers. In addition, I fixed two minor bugs with nested submenus being not correctly hidden in some cases (see commit messages for more details). I tested everything on Chrome mobile on Android (with touch and Bluetooth mouse) Firefox mobile on Android (with touch and Bluetooth mouse) Chromium on Linux/X11 (with multitouch screen and mouse) Firefox on Linux/X11 (with multitouch screen and mouse)
Bug Report
Similar to #1988 a number of dropdowns will not work upon clicking with a mouse on iPad (namely a trackpad in my case). This again is using iPadOS 14.6. As per the slider, touch events work as expected
Steps to reproduce
Expected result
All dropdowns should open
Actual result
A number of dropdowns do not open
Version
2.8.7
The text was updated successfully, but these errors were encountered: