From e70c1e9c6cdb9af0c1c81e7c03a7c57d10ee30a8 Mon Sep 17 00:00:00 2001 From: Steffen Becker Date: Fri, 11 Sep 2026 00:42:55 +0200 Subject: [PATCH] fix: only the primary button picks a frame behind the text A right-click over one selected it and swallowed the mousedown, where the browser's own context-menu handling should have the point. Claude-Session: https://claude.ai/code/session_01Wzs2qG6Y5qm7mKmJHfu44G --- src/lib/editor/extensions/image.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/editor/extensions/image.ts b/src/lib/editor/extensions/image.ts index 43463cf..72eb03d 100644 --- a/src/lib/editor/extensions/image.ts +++ b/src/lib/editor/extensions/image.ts @@ -329,7 +329,10 @@ function behindTextPlugin(): Plugin { handleDOMEvents: { mousedown(view, event) { const at = event.target; - if (!view.editable || (at instanceof HTMLElement && at.closest('[data-wrap="through"]'))) return false; + // The primary button only: a right-click keeps whatever the browser's own + // context-menu handling does with the point. + if (!view.editable || event.button !== 0) return false; + if (at instanceof HTMLElement && at.closest('[data-wrap="through"]')) return false; const frame = frameBehindPoint(view, event.clientX, event.clientY); if (!frame) return false; event.preventDefault();