Bug 214609
| Summary: | Safari on iOS fires "pointerenter" with mouse pointerType in addition to touch | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Devon Govett <govett> |
| Component: | UI Events | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | ahmad.saleem792, rsnow, thorton, webkit-bug-importer, wenson_hsieh, yivarak978 |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 13 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=210716 | ||
Devon Govett
When you have an element with a `tabIndex`, Safari on iOS fires the "pointer enter" and "pointerleave" events twice: once with `pointerType` set to "touch", and again with `pointerType` set to "mouse". After touching and releasing the element, the events fired are:
* pointer enter: pointerType = "touch"
* pointer leave: pointerType = "touch"
* pointer enter: pointerType = "mouse"
A pointer leave event with pointerType = "mouse" is not fired until the element is blurred (e.g. by tapping on something else that's focusable). Based on this information, it appears that focus/blur events are also causing pointer enter/pointer leave events.
You can try this out in a demo here: https://codepen.io/devongovett/pen/QWyYWYa
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/65899993>
Wenson Hsieh
> * pointer enter: pointerType = "touch"
> * pointer leave: pointerType = "touch"
> * pointer enter: pointerType = "mouse"
These seem like events that would be fired when dispatching synthetic click events, which should be fixed in the iOS 14 beta.
Ahmad Saleem
I am unable to reproduce this bug using iOS 15.6.1 on iPhone 13 Pro Max and it does not show ‘mouse’ with positionenter in the demo from Comment 0.
@Devon - if it is reproducible, appreciate if you can share updated testcase. Thanks!
Devon Govett
I can confirm that it appears to be fixed in the latest iOS version.
Rob Snow
There seems to be a related issue in iOS 26. I can open another issue if that's preferred.
https://codepen.io/snowystinger/pen/OPXOOGO
To reproduce, touch the "x", which will be removed when the checkbox is checked.
When you have an element that is removed in the midst of an onChange, pointerLeave is fired with `pointerType` set to "mouse".
It may be fired twice, with a preceding event with `pointerType` set to "touch". Depends on how far off to the right side you are.
These are the possible leave event scenarios:
* pointer leave: touch
* pointer leave: mouse
or just
*pointer leave: mouse