Bug 202287 - pointerdown events are not fired for clicks that follow a drag&drop.
Summary: pointerdown events are not fired for clicks that follow a drag&drop.
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: Safari Technology Preview
Hardware: Mac macOS 10.14
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-09-26 14:12 PDT by Aurélien Roy
Modified: 2024-02-12 23:10 PST (History)
11 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aurélien Roy 2019-09-26 14:12:32 PDT
Bug confirmed on stable releases of :
 - Safari 13.0.0 / Mojave 10.14.6
 - Safari 13.0.1 / Mojave 10.14.6

Overview :

"pointerdown" events are not fired for clicks that follow a drag&drop.

How to reproduce :

- Add an event listener to a draggable DOM element for "pointerdown" event.
- If you click on it, the event will fre.
- Drag the element and release it.
- The next time you will click on it, "pointerdown" event won't fire.
- Following clicks will work again until the next drag&drop.

Codepen : https://codepen.io/Tlokuus/pen/JjPVrLy


This causes some commonly used JS libraries do not work propertly, for instance :
 https://github.com/SortableJS/Sortable/issues/1571
Comment 1 Radar WebKit Bug Importer 2019-09-26 19:53:04 PDT
<rdar://problem/55768441>
Comment 2 Antoine Quint 2019-09-30 08:06:45 PDT
The "mousedown" and "click" events are fired as expected, odd!
Comment 3 Antoine Quint 2019-10-01 04:40:14 PDT
We're actually dispatching a "pointermove" event instead of a "pointerdown" event because we believe the pointer is still pressed in PointerCaptureController::pointerEventForMouseEvent():

        // We're already active and getting another mousedown, this means that we should dispatch
        // a pointermove event and let the button state show the newly depressed button.
        if (type == names.mousedownEvent && capturingData.pointerIsPressed)
            return PointerEvent::create(names.pointermoveEvent, button, mouseEvent);

We must not clear the pointerIsPressed state during drag-and-drop.
Comment 4 lvegerano422 2020-03-03 10:38:54 PST
Anyone knows the status of this bug? This is very alive in Safari 13.0.5
Comment 5 Binyamin 2020-08-11 22:30:27 PDT
This bug is breaking compatibility to different libraries, for example https://github.com/SortableJS/Sortable/issues/1571
Comment 6 George Zizka 2020-11-08 10:43:58 PST
This issue still persist even in Safari 14 Preview
Comment 7 Rob Snow 2022-05-12 10:04:14 PDT
Any status? this is still present in 15.4 and is causing us grief in our library react-aria
Comment 8 JC Franco 2024-02-12 23:10:34 PST
I am able to reproduce with v17.2.1 (19617.1.17.11.12).