Bug 244097 - "Wheel" events are not dispatched in iOS Safari when overscroll is disabled
Summary: "Wheel" events are not dispatched in iOS Safari when overscroll is disabled
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Scrolling (show other bugs)
Version: Safari 15
Hardware: iPhone / iPad iOS 15
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-08-18 10:56 PDT by Jarod Gowgiel
Modified: 2022-08-25 10:57 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jarod Gowgiel 2022-08-18 10:56:08 PDT
In iOS Safari, scrolling with a connected mouse does not work on sites that have disabled overscroll with some specific CSS rules. Specifically, `wheel` events are not dispatched to elements that have `overflow: hidden` or `overflow: none` when a mouse wheel is used on them. As noted in the bug linked below, hiding the address bar seems to "fix" this problem (by re-enabling overscroll, I think).

Preconditions that are necessary for this bug to happen:
* A <meta> tag like: `<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=yes">`
* Specific `body` and `html` styling rules, with `width: 100%` and `height: 100%`

I've managed to generate a reproducible case at https://codepen.io/JarodG/pen/gOeZmpK?editors=1111. Note that, because of Codepen's handling of browser focus in the default editor, you'll need to follow a few setup steps if you don't have a "Pro" subscription:
* Fork the linked Codepen via the button in the bottom right toolbar.
* Open the forked Codepen in debug mode by replacing "pen" in the URL with "debug", or by using the "view" icon in the top right to switch to debug mode.

Notice: 
* Scrolling in any of the three boxes in debug mode in desktop Safari or Chrome causes `wheel` events to be properly dispatched.
* In a Simulator instance, or on an iPad, open the same debug view and connect a mouse (either via Bluetooth for a physical device, or via "Send Pointer to Device" in the simulator).
* Wheel events will only be dispatched to the first box, and not to either of the other boxes.

I believe this bug is related to https://bugs.webkit.org/show_bug.cgi?id=226080 - it may be the same issue, or it may not, since the link provided by inikolic@microsoft.com has since gone dark and I can't compare the structure of that page to my reproducible case.

thorton@apple.com, I'm adding you to the CC list here since you were mentioned in both the aforementioned bug, and https://bugs.webkit.org/show_bug.cgi?id=210071 which initially added `wheel` support for iOS.
Comment 1 inikolic@microsoft.com 2022-08-19 04:22:03 PDT
Hi, Isidor here from the VS Code team. Please let us know if there is any more details we can provide to help here. This is a long standing issue on our side https://github.com/microsoft/vscode/issues/106232
Comment 2 inikolic@microsoft.com 2022-08-19 04:25:07 PDT
You can use the following url instead of the previous one that has gone dark

https://vscode.dev/ from there you should be able to open a new empty file and notice that the mouse wheel is not working on the iPad.

And thanks a lot for looking into this. We really appreciate it.
Comment 3 Jarod Gowgiel 2022-08-19 08:49:34 PDT
Hey Isidor - thanks for the link! We're running into an issue that's very similar to what VSCode is seeing over in Lucid Software's products (who I'm investigating this issue for). I think the same problem here is impacting VSCode in the browser as well - after some brief poking, it looks like the core editor is a custom implementation of a scrollable window, which uses `overflow: hidden`, and the same rules (including the <meta> tag) that cause the issue on our sites.

I can't think of any potential resolutions that we can take from the app side in either case, since it seems like both products rely on overscroll being disabled to improve the user experience. iOS Safari seems to be in violation of the W3 spec in this situation:

> A user agent MUST dispatch this event when a mouse wheel has been rotated around any axis, or when an equivalent input device (such as a mouse-ball, certain tablets or touchpads, etc.) has emulated such an action.

Keyword "MUST", and I think the bug here is that the event is, under certain conditions, not being dispatched at all.
Comment 4 Jarod Gowgiel 2022-08-19 08:50:37 PDT
(In reply to Jarod Gowgiel from comment #3)
> Hey Isidor - thanks for the link! We're running into an issue that's very
> similar to what VSCode is seeing over in Lucid Software's products (who I'm
> investigating this issue for). I think the same problem here is impacting
> VSCode in the browser as well - after some brief poking, it looks like the
> core editor is a custom implementation of a scrollable window, which uses
> `overflow: hidden`, and the same rules (including the <meta> tag) that cause
> the issue on our sites.
> 
> I can't think of any potential resolutions that we can take from the app
> side in either case, since it seems like both products rely on overscroll
> being disabled to improve the user experience. iOS Safari seems to be in
> violation of the W3 spec in this situation:
> 
> > A user agent MUST dispatch this event when a mouse wheel has been rotated around any axis, or when an equivalent input device (such as a mouse-ball, certain tablets or touchpads, etc.) has emulated such an action.
> 
> Keyword "MUST", and I think the bug here is that the event is, under certain
> conditions, not being dispatched at all.

Quote taken from: https://www.w3.org/TR/uievents/#events-wheelevents
Comment 5 Simon Fraser (smfr) 2022-08-19 10:18:34 PDT
This is being tracked internally via <rdar://88885351>.
Comment 6 Radar WebKit Bug Importer 2022-08-25 10:57:33 PDT
<rdar://problem/99146306>