-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Press events are not dispatched correctly on iOS Chrome/Safari #1061
Comments
I was able to reproduce the same issue by using Chrome's desktop built-in mobile emulator: Screencast: https://d.pr/v/b5dY6k |
Interesting. Maybe iOS is doing some kind of fuzzy hit testing? Like where you hit within some margin of the button it still fires? But it must not do that for pointer/touch events. |
Yeah that's what I assumed. I guess we'd have to implement our own hit test padding if we wanted to support this. That would likely be a big task since we don't currently implement our own global hit testing and rely on e.g. |
@devongovett I’ve showed the issue to @diegohaz and he thinks the issue might be caused by react-spectrum/packages/@react-aria/interactions/src/usePress.ts Lines 641 to 647 in b8e7a96
|
Is |
Yes; |
This project is not something we are able to take on at this time. We are happy to work with anyone interested in contributing this improvement. |
🐛 Bug Report
Press events are not dispatched correctly on iOS.
I've created a
Button
component with theuseButton
hook and I noticed press events are not dispatched correctly (but click events are) on iOS Chrome/Safari (I didn't test on Android) if you click in any of the Button edges. It works on desktop though.🤔 Expected Behavior
useButton
/usePress
should dispatch press events every time a click event would be dispatched.😯 Current Behavior
Screencast showing the problem on Chrome iOS: https://d.pr/v/5haGuQ
💻 Code Sample
Codesandbox link: https://codesandbox.io/s/sad-meitner-ssc9k
🌍 Your Environment
The text was updated successfully, but these errors were encountered: