Skip to content
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

Bug: onContextMenu not fired in iOS 13 and later #21812

Closed
robatwilliams opened this issue Jul 7, 2021 · 4 comments
Closed

Bug: onContextMenu not fired in iOS 13 and later #21812

robatwilliams opened this issue Jul 7, 2021 · 4 comments
Labels
Resolution: Stale Automatically closed due to inactivity Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@robatwilliams
Copy link

robatwilliams commented Jul 7, 2021

From v13 onwards, iOS doesn't fire contextmenu events on long-press. It only displays the "touch callout".

This inconsistency with all other browser seems, like something synthetic events could handle:

Your event handlers will be passed instances of SyntheticEvent, a cross-browser wrapper around the browser’s native event. It has the same interface as the browser’s native event, including stopPropagation() and preventDefault(), except the events work identically across all browsers.

React version: 17.0.2

Steps To Reproduce

  1. Long-press an element with an onContextMenu listener

Link to code example: https://www.quirksmode.org/dom/events/tests/contextmenu.html

The current behavior

React onContextMenu listeners are not called.

The expected behavior

React onContextMenu listeners are called.

Workarounds

  • Use a timer to detect long-press, or a library that does that
  • Use an alternative user interaction - which is perhaps what Apple would rather you do, but degrades the experience for non-native apps

References

@robatwilliams robatwilliams added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Jul 7, 2021
@robatwilliams
Copy link
Author

They're not fired in iOS 12 either

@stale
Copy link

stale bot commented Jan 9, 2022

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

Copy link

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 10, 2024
@robatwilliams
Copy link
Author

According to MDN and the linked webkit bug, and that there doesn't appear to have been any React effort to solve it, it is most likely still an issue.

It's not a problem for my current work nor do I have a setup to test it out conveniently, so I'll leave it at this.

Ultimately it's Apple that "should" fix this anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Stale Automatically closed due to inactivity Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

1 participant