From d18caf611632604b22ff40c9ebee722caf9a4991 Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Mon, 15 Jun 2026 23:04:43 +0100 Subject: [PATCH] Fix PDF text selection locked out on touch devices (#6656) --- .../src/core/components/viewer/LocalEmbedPDF.tsx | 12 ++++++------ .../viewer/LocalEmbedPDFWithAnnotations.tsx | 9 +++++---- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/frontend/editor/src/core/components/viewer/LocalEmbedPDF.tsx b/frontend/editor/src/core/components/viewer/LocalEmbedPDF.tsx index 92f025efc..66af74fb6 100644 --- a/frontend/editor/src/core/components/viewer/LocalEmbedPDF.tsx +++ b/frontend/editor/src/core/components/viewer/LocalEmbedPDF.tsx @@ -243,12 +243,12 @@ export function LocalEmbedPDF({ drawBlackBoxes: false, }), - // Register pan plugin (depends on Viewport, InteractionManager) - createPluginRegistration(PanPluginPackage, { - defaultMode: "mobile", // Try mobile mode which might be more permissive - }), - // Register pan plugin (depends on Viewport, InteractionManager) - keep disabled to prevent drag panning - createPluginRegistration(PanPluginPackage, {}), + // Register pan plugin (depends on Viewport, InteractionManager). + // Keep the default mode ("never"). Do NOT set defaultMode: "mobile" - the pan + // react layer makes pan the default interaction on any touch-capable device + // (navigator.maxTouchPoints > 0), e.g. Windows touchscreen laptops, which then + // permanently locks the viewer in pan mode and blocks all text selection. + createPluginRegistration(PanPluginPackage), // Register zoom plugin with configuration createPluginRegistration(ZoomPluginPackage, { diff --git a/frontend/editor/src/core/components/viewer/LocalEmbedPDFWithAnnotations.tsx b/frontend/editor/src/core/components/viewer/LocalEmbedPDFWithAnnotations.tsx index f23bcc18b..25dcf7446 100644 --- a/frontend/editor/src/core/components/viewer/LocalEmbedPDFWithAnnotations.tsx +++ b/frontend/editor/src/core/components/viewer/LocalEmbedPDFWithAnnotations.tsx @@ -300,10 +300,11 @@ export const LocalEmbedPDFWithAnnotations = forwardRef< selectAfterCreate: true, }), - // Register pan plugin - createPluginRegistration(PanPluginPackage, { - defaultMode: "mobile", - }), + // Register pan plugin. Keep the default mode ("never"). Do NOT set + // defaultMode: "mobile" - it makes pan the default interaction on any + // touch-capable device (e.g. Windows touchscreen laptops) and blocks + // text selection. + createPluginRegistration(PanPluginPackage), // Register zoom plugin createPluginRegistration(ZoomPluginPackage, {