Skip to content

#1 PDF Application on GitHub that lets you edit PDFs on any device anywhere

Fix PDF text selection locked out on touch devices (#6656)

Anthony Stirlingd18caf611632
diff --git a/frontend/editor/src/core/components/viewer/LocalEmbedPDF.tsx b/frontend/editor/src/core/components/viewer/LocalEmbedPDF.tsx
index 92f025efcb..66af74fb67 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 f23bcc18b5..25dcf74461 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, {