Files
firefox/devtools/client/shared/components/splitter
Masayuki Nakano f27ebf7d6c Bug 1907490 - Make Draggable listen to pointerdown to capture the pointer r=nchevobbe,devtools-reviewers
`MouseEvent.pointerId` is `undefined` so that `setPointerCapture(undefined)`
means `setPointerCapture(0)` and it captures both click of mouse and first
touch of touch input devices.  It needs to listen to `pointerdown` event to
get the correct `pointerId` value.  Then, it can use only `pointerdown` and
`pointerup` because they are fired before `mousedown` and `mouseup`.
Additionally, it handles a drag while a mouse button is pressed.  Therefore,
it can ignore pointer events which are caused by other devices.

Although it's not required explicitly to release the capture when the pointer
is up, it needs to release capturing the pointer if `Escape` is pressed.
Therefore, this patch keeps the explicit release call.

Depends on D217216

Differential Revision: https://phabricator.services.mozilla.com/D217217
2024-07-22 08:05:35 +00:00
..
…