[Webkit-unassigned] [Bug 216681] New: iOS: Change events are fired on incorrect elements if a dblclick listener is registered on a parent
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Sep 17 19:42:41 PDT 2020
https://bugs.webkit.org/show_bug.cgi?id=216681
Bug ID: 216681
Summary: iOS: Change events are fired on incorrect elements if
a dblclick listener is registered on a parent
Product: WebKit
Version: Safari 13
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: UI Events
Assignee: webkit-unassigned at lists.webkit.org
Reporter: govett at adobe.com
In iOS 13 and 14 (have not tested on previous versions of iOS), "change" events (and potentially others) can be fired on an incorrect element if a dblclick listener is registered on a parent element. For example, in a group of checkboxes or radios, tapping quickly between two inputs fires the change event on the first element you tapped twice rather than on the second element. In a group of checkboxes, tapping on one checkbox and then a second should toggle each, but if you do it fast enough, it toggles the first twice instead. This only occurs when a dblclick listener is registered on any parent element above the inputs. It appears that registering the dblclick listener has a side effect of changing the behavior of which element subsequent events after an initial tap are fired on.
Example reproduction: https://fbwry.csb.app/
Source: https://codesandbox.io/s/staging-fog-fbwry?file=/index.html
This manifested in React, which implements event delegation by registering listeners for all known events on a root element, and relies on bubbling to handle events for children. Because of this, there is always a dblclick listener registered at the root of the app, and so this bug is visible even if nothing inside has double click functionality.
Related React issue: https://github.com/facebook/react/issues/19841.
I did a brief search and found this line which looks potentially problematic to me: https://github.com/WebKit/webkit/blob/950143da027e80924b4bb86defa8a3f21fd3fb1e/Source/WebCore/page/ios/FrameIOS.mm#L522. Appears to have been introduced by the patch for this bug: https://bugs.webkit.org/show_bug.cgi?id=197347. I could be completely off though as I haven't worked on Webkit before. ;)
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200918/f48cb5f0/attachment.htm>
More information about the webkit-unassigned
mailing list