| Summary: | iOS: Change events are fired on incorrect elements if a dblclick listener is registered on a parent | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Devon Govett <govett> |
| Component: | UI Events | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW --- | ||
| Severity: | Normal | CC: | bdakin, dan.abramov, graouts, graouts, hi, rniwa, simon.fraser, webkit-bug-importer, wenson_hsieh |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 13 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
|
Description
Devon Govett
2020-09-17 19:42:41 PDT
I want to add that this doesn't only affect the "change" event, but the "click" event itself. The issue itself also seems scoped to interactive elements like buttons and checkboxes, but does NOT occur for divs with onclick listeners. Here's a few different repro cases to compare. ## Working Case (Divs) https://codesandbox.io/s/falling-shape-fjptk?file=/src/index.js (live demo: https://fjptk.csb.app/) Click A twice. Expected and actual: click(A), click(A), and dblclick(A). (All good!) Quickly tap A and then B. Expected and actual: click(A), click(B). (All good — no double click because target has changed!) ## Broken Case (Checkboxes) https://codesandbox.io/s/recursing-glade-ysxv2 (live demo: https://ysxv2.csb.app/) Click A twice. Expected and actual: click(A), click(A), and dblclick(A). (All good!) Quickly tap A and then B. Expected: click(A), click(B). ACTUAL (broken): click(A), click(A), dblclick(A). As you can see, here switching from A to B still keeps dispatching events on A, even though the target has changed. Buttons are broken in the same way as checkboxes. It is also curious that the problem seems to go away if the taps have a certain distance between them. E.g. if I decrease the checkbox size via styles I can reproduce it more often. If they are large and I keep them further apart then I struggle to repro. |