Add 'text' interaction mode for PDF (selection-only, no smart detection)

'select' keeps smart behavior (drag text to select, drag blank to
pan); 'text' always defers to the text/annotation layer so drags
never pan — for users who want pure selection. Shift still force-pans
in both modes; 'pan' remains force-pan.
This commit is contained in:
2026-08-14 14:24:41 -04:00
parent d4d87a94f8
commit 29bc958c26
+3 -1
View File
@@ -116,7 +116,7 @@ export class FixedLayout extends HTMLElement {
break;
}
case "interaction-mode": {
if (value === "pan" || value === "select") {
if (value === "pan" || value === "select" || value === "text") {
this.#interactionMode = value;
}
break;
@@ -496,6 +496,8 @@ export class FixedLayout extends HTMLElement {
#handleMouseDown(event) {
if (event.button !== 0) return;
if (this.#isPDF && this.#interactionMode === "text" && !event.shiftKey)
return false;
if (this.#isPDF && this.#interactionMode === "select" && !event.shiftKey) {
const t = event.realTarget;
if (