Skip to content

Commit 92cd56b

Browse files
authored
fix: prevent cell selection on context menu open (#324)
1 parent 1ebd21e commit 92cd56b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/input.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,11 @@ export function handleMouseDown(
174174
view: EditorView,
175175
startEvent: MouseEvent,
176176
): void {
177+
// Only handle mouse down events for the main button (usually the left button).
178+
// This ensures that the cell selection won't be triggered when trying to open
179+
// the context menu.
180+
if (startEvent.button != 0) return;
181+
177182
if (startEvent.ctrlKey || startEvent.metaKey) return;
178183

179184
const startDOMCell = domInCell(view, startEvent.target as Node);

0 commit comments

Comments
 (0)