WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
260722
REGRESSION (iPadOS 17): Right click causes native contextual menu to appear over web app context menu
https://bugs.webkit.org/show_bug.cgi?id=260722
Summary
REGRESSION (iPadOS 17): Right click causes native contextual menu to appear o...
Keith Posehn
Reported
2023-08-25 11:40:28 PDT
Created
attachment 467435
[details]
Right click behavior in monaco editor Original issue [#244149](
https://bugs.webkit.org/show_bug.cgi?id=244149
) seems to have reappeared in iPadOS 17. Existing prescribed methods of disabling the native context menu do not work, possibly due to the original fix no longer working. * This behavior appears in iPadOS 17 beta 1 through 7 (current) and is present in Safari along with WKWebView. * Affected apps include [VSCode.dev](
https://github.com/microsoft/vscode/issues/170345
) (or any web based instance of Monaco editor), Google Docs, Blink Shell, [Code App](
https://github.com/thebaselab/codeapp/issues/921
), Figma, etc. Steps to reproduce: 1. Install iPadOS 17 on iPad 2. Connect to external mouse/trackpad/magic-keyboard 3. Open any app noted above 4. Right click Notes: * I can’t validate if this is due to the original issue or not at this time * I made my own WKWebView app and tried each of the fixes described before, none worked * On VSCode.dev there were a few weird instances where it stopped, but only briefly, due to a way that the web app text selection differed from the OS; I haven’t been able to replicate these
Attachments
Right click behavior in monaco editor
(300.04 KB, image/jpeg)
2023-08-25 11:40 PDT
,
Keith Posehn
no flags
Details
Native OS menu appearing over Google Docs right click menu
(625.55 KB, image/jpeg)
2023-08-25 17:22 PDT
,
Keith Posehn
no flags
Details
Example in VSCode.dev (Monaco Editor)
(421.17 KB, image/jpeg)
2023-08-25 17:30 PDT
,
Keith Posehn
no flags
Details
Mini keyboard floater
(147.93 KB, image/jpeg)
2023-08-25 17:57 PDT
,
Keith Posehn
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Kurt Revis
Comment 1
2023-08-25 17:08:08 PDT
I'm not having any luck reproducing this on iPadOS beta 7, with an Apple Magic Keyboard (with trackpad). Tried two-finger click and control-click, in Safari, with: -
https://developer.mozilla.org/en-US/docs/Web/API/Element/contextmenu_event
-
https://codepen.io/krevis-figma/pen/yLKejBa
- Figma (On
https://codepen.io/krevis-figma/pen/yLKejBa
, if I hold down control and tap on the screen with a finger, I am getting a menu. But that's a pretty weird case, and the same in iPadOS 16.6, not a a regression.) Any other info you can provide? Could be specific to your pointing device (which one are you using?) or some other system setting, or some state somewhere.
Keith Posehn
Comment 2
2023-08-25 17:21:47 PDT
Thanks Kurt for the response. I’m using the exact same thing actually and this has been reported elsewhere, so maybe we’re referring to different things? I’ll do my best to explain. - I think in both of those instances, you were seeing the native OS menu on a right click as opposed to the menu the web app wants to show - In Figma if I open a drawing or project and right click in the canvas the native OS menu shows up on top of the html5 menu that is intended - The same occurs in google docs if you’re editing a document, or in VSCode.dev if you’re editing code - This has been replicated by others in the issues I linked to, so if its a system setting or state somewhere it is apparently widespread I just checked on my wife’s iPad Pro running the latest version of iPadOS 16 and the issue isn’t present there. It seems limited only to iPadOS 17 at this point, so potentially a change in the UIEditMenuInteraction APIs again? I’ll add some attachments to further illustrate
Keith Posehn
Comment 3
2023-08-25 17:22:59 PDT
Created
attachment 467444
[details]
Native OS menu appearing over Google Docs right click menu This is a clearer example of the native OS menu appearing over the web app menu in iPadOS 17
Keith Posehn
Comment 4
2023-08-25 17:25:31 PDT
An additional note: in your CodePen example, did you intend for the code to preventDefault on context menu to stop the native OS menu from appearing? If so, it still appears in iPadOS 17 Code: window.addEventListener('contextmenu', function(e) { log('CONTEXTMENU'); e.preventDefault(); });
Keith Posehn
Comment 5
2023-08-25 17:30:34 PDT
Created
attachment 467445
[details]
Example in VSCode.dev (Monaco Editor) One more example, this time in VSCode.dev inside a WKWebView
Kurt Revis
Comment 6
2023-08-25 17:47:47 PDT
Yep, I understand the bug you're describing -- I'm the one who filed it for the iOS 16 betas (
https://bugs.webkit.org/show_bug.cgi?id=244149
), and I'd like to help make sure it doesn't come back. I just can't actually repro it on 17 beta 7!
Keith Posehn
Comment 7
2023-08-25 17:57:55 PDT
Created
attachment 467446
[details]
Mini keyboard floater
Keith Posehn
Comment 8
2023-08-25 18:06:17 PDT
After my last comment I saw you’re the OP - very glad to have your eyes on this. I realized you were likely testing this with only a mouse - not a physical keyboard. So, I disconnected my physical keyboard and voila! No problem on iPadOS 17. When the touch keyboard is present it may properly prevent the default behavior, but when a physical keyboard is connected it seems to fail. It may also have to do with the little floating keyboard that shows up in the app window at the same time. To double verify, I went back and used my wife’s iPad Pro with the magic keyboard (including trackpad) and iPadOS 16 doesn’t have the issue, so it may indeed be limited to 17. Any thoughts? Thanks for the quick responses.
Alexey Proskuryakov
Comment 9
2023-08-28 10:50:05 PDT
For context,
bug 244149
was fixed in iOS 16.2.
Radar WebKit Bug Importer
Comment 10
2023-08-28 10:50:29 PDT
<
rdar://problem/114572776
>
Smoley
Comment 11
2023-08-29 12:46:42 PDT
This does not reproduce for me on Beta 8 (21A5326a) when testing with docs.google.com and iPad Pro with Magic Keyboard (using the built in trackpad to context click with 2 fingers). Does this still reproduce for you on Beta 8? Thanks.
Keith Posehn
Comment 12
2023-08-29 13:20:09 PDT
Initial test in beta 8 reproduces it in VSCode.dev, WKWebView and Google Docs. Will try again later today.
Keith Posehn
Comment 13
2023-08-29 18:03:49 PDT
Following up: - I am running iPad OS 17 Beta 8 (Build 21A5326a) - The issue still presents with external keyboard and trackpad, magic keyboard (with built-in trackpad) but not if no keyboard is present - If a wireless usb keyboard dongle is plugged in but the keyboard is not connected, the issue persists even if the keyboard is not powered on - I’ve tested this in WKWebView, Code App, VSCode.dev, Figma, Google Docs @Smoley: Can you take a screenshot of your settings in Settings -> General -> Keyboard? I’m curious if there’s a difference between us. I have Shortcuts, Predictive and “.” Shortcut deactivated.
Keith Posehn
Comment 14
2023-09-01 11:34:45 PDT
Did a bit more testing today with the following scenarios: 1. Does this issue present only with usb-based keyboards? I tried disconnecting the USB dongle and using bluetooth to connect my keyboard. For a minute the issue wasn't present in WKWebView but then it reappeared. Google Docs and Figma still presented the issue. 2. Is there an option in the keyboard settings that causes this issue? I've gone through each setting and the issue is still present, both for overall keyboard settings and hardware-specific settings. 3. Is this behavior specific to trackpads and not mice? Not quite... 4. Is this behavior specific to tap-to-click? Yes! The culprit is apparently the tap-to-click setting in iPad OS. Turning it off stops it from on my side, but enabling it causes it to happen. I can have both a regular mouse and a magic trackpad connected and it happens only when using the trackpad, not the mouse. @Smoley, did you have tap-to-click enabled when you tried it? As near as I can tell the touch interaction is happening in a different way than mouse click. I'm not sure if this is how Webkit interprets the signal or if the signal from the OS is now different in some way. Unfortunately for me, I have to have tap-to-click enabled so I can't just turn it off (or use a mouse).
Kurt Revis
Comment 15
2023-09-01 11:45:38 PDT
Aha, I thought a setting might be involved. To be more explicit: The key is to turn on the system setting General > Trackpad > Tap to Click. Then, to trigger the bug, lightly tap on the Magic Keyboard's surface, enough to register as a tap, but not enough to be a full click that causes haptics. Either two fingers tapping, or holding the control key and tapping with one finger, will cause the system context menu to appear. I can repro this on both iPadOS 16.6 (20G75) and 17 beta 8 (21A5236a), so it isn't a regression in 17.
Kurt Revis
Comment 16
2023-09-01 11:46:21 PDT
(Magic Keyboard's *trackpad* surface, that is.)
Keith Posehn
Comment 17
2023-09-01 15:33:25 PDT
I just tried on my wife's iPad Pro (similar spec, iPadOS 16) and turned on tap-to-click and it presents there as well. Looking into it further, it seems to be some mishandling of the touch event itself (either in iPadOS or Webkit), possibly because the OS exposes the trackpad as a multi-touch device instead of as a simple pointer. Perhaps it is somewhere in this class:
https://developer.apple.com/documentation/uikit/uitapgesturerecognizer
Maybe the app needs to recognize a tap gesture (with the criteria being one tap from two fingers) and then prevent that event from being fired?
Keith Posehn
Comment 18
2023-09-06 20:00:47 PDT
Follow-up on some interesting behavior I've found: Web Clips (using the Safari "Add to Home Screen" option) and Safari View Controllers do not consistently have this issue Some Web Clips (Airtable for instance) don't have this issue while others do (Google Docs, VSCode). However, *all* Safari View Controller instances I've tested don't have this problem. I've tried this with VSCode and Google Docs for example. So there seems to be a difference between how Safari/Webkit proper handle the two-finger-tap that isn't the same in a simple Safari View Controller. Yet Airtable in a Web Clip doesn't have this problem at all, while all others tested do.
Keith Posehn
Comment 19
2023-12-19 08:44:16 PST
Checking in as it's been months and the issue persists. As an aside, I've identified additional issues in WebKit on iPad that come up for mouse/keyboard/trackpad users that I'll raise separately.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug