diff --git a/CHANGELOG.md b/CHANGELOG.md index c32d624..f4b617f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [Unreleased] + +### Fixed + +- Only accept primary button (left-click) for activating drag with default + pointer sensor. Fix an issue on some platforms where the contextmenu shows on + right-click and intercepts the pointerup events that would cancel the drag, + leading to a sticky unintended drag. + ## [0.7.2] - 2022-10-07 ### Fixed diff --git a/src/create-pointer-sensor.ts b/src/create-pointer-sensor.ts index fc0c94f..3696983 100644 --- a/src/create-pointer-sensor.ts +++ b/src/create-pointer-sensor.ts @@ -40,6 +40,8 @@ const createPointerSensor = (id: Id = "pointer-sensor"): void => { let activationDraggableId: Id | null = null; const attach: SensorActivator<"pointerdown"> = (event, draggableId) => { + if (event.button !== 0) return; + document.addEventListener("pointermove", onPointerMove); document.addEventListener("pointerup", onPointerUp);