Bug 214609 - Safari on iOS fires "pointerenter" with mouse pointerType in addition to touch
Summary: Safari on iOS fires "pointerenter" with mouse pointerType in addition to touch
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: Safari 13
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-07-21 11:55 PDT by Devon Govett
Modified: 2024-04-04 13:09 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Devon Govett 2020-07-21 11:55:19 PDT
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
Comment 1 Radar WebKit Bug Importer 2020-07-21 13:28:24 PDT
<rdar://problem/65899993>
Comment 2 Wenson Hsieh 2020-07-21 14:30:06 PDT
> * 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.
Comment 3 Ahmad Saleem 2022-09-03 14:01:21 PDT
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!
Comment 4 Devon Govett 2022-09-06 15:53:34 PDT
I can confirm that it appears to be fixed in the latest iOS version.
Comment 5 Jekkerdes 2024-04-04 13:09:07 PDT
I noticed that Safari on iOS triggers the "pointerenter" event even for touch interactions, and it reports the pointerType as "mouse" instead of "touch". This seems like unexpected https://www.linkedin.com/pulse/best-law-essay-writing-services-uk-gloria-kopp-wt82e behavior, so I'm making a note to investigate further.