Skip to content

Commit 10d5186

Browse files
fix(web): a sidebar click no longer gets lost when the release reports no buttons
A buttons=0 pointermove before pointerup cancelled a press that had not yet passed the drag distance and installed click suppression, so the row's click never ran and thread switching took several clicks. A pending press now finishes like a normal release; active drags still drop context and cancel. Fixes #22058 AI-assisted; verified with the tests and tools listed above.
1 parent f912209 commit 10d5186

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎apps/web/src/components/Sidebar.pointer.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@ export class SidebarPointerSensor {
5959
private move = (event: PointerEvent) => {
6060
if (this.phase === "finished" || event.pointerId !== this.pointer.pointerId) return;
6161
const coordinates = { x: event.clientX, y: event.clientY };
62-
// Desktop may report buttons=0 before pointerup; drop active context drags before cancelling sort.
62+
// Desktop may report buttons=0 before pointerup: a pending press is released like pointerup so its
63+
// click lands; an active drag drops context before cancelling sort.
6364
if ((event.buttons & 1) === 0) {
64-
if (this.phase === "dragging") this.props.options.onDrop?.(coordinates);
65+
if (this.phase === "pending") return this.finish(false);
66+
this.props.options.onDrop?.(coordinates);
6567
return this.cancel();
6668
}
6769
if (this.phase === "pending") {

0 commit comments

Comments
 (0)