Skip to content

Commit de6a277

Browse files
Only accept primary button for activating drag.
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. For #30
1 parent 50da811 commit de6a277

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## [Unreleased]
4+
5+
### Fixed
6+
7+
- Only accept primary button (left-click) for activating drag with default
8+
pointer sensor. Fix an issue on some platforms where the contextmenu shows on
9+
right-click and intercepts the pointerup events that would cancel the drag,
10+
leading to a sticky unintended drag.
11+
312
## [0.7.2] - 2022-10-07
413

514
### Fixed

src/create-pointer-sensor.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ const createPointerSensor = (id: Id = "pointer-sensor"): void => {
4040
let activationDraggableId: Id | null = null;
4141

4242
const attach: SensorActivator<"pointerdown"> = (event, draggableId) => {
43+
if (event.button !== 0) return;
44+
4345
document.addEventListener("pointermove", onPointerMove);
4446
document.addEventListener("pointerup", onPointerUp);
4547

0 commit comments

Comments
 (0)