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

This commit is contained in:
Anthony Stirling
2026-06-15 23:04:43 +01:00
committed by GitHub
parent 3bafbb1919
commit d18caf6116
2 changed files with 11 additions and 10 deletions
@@ -243,12 +243,12 @@ export function LocalEmbedPDF({
drawBlackBoxes: false, drawBlackBoxes: false,
}), }),
// Register pan plugin (depends on Viewport, InteractionManager) // Register pan plugin (depends on Viewport, InteractionManager).
createPluginRegistration(PanPluginPackage, { // Keep the default mode ("never"). Do NOT set defaultMode: "mobile" - the pan
defaultMode: "mobile", // Try mobile mode which might be more permissive // react layer makes pan the default interaction on any touch-capable device
}), // (navigator.maxTouchPoints > 0), e.g. Windows touchscreen laptops, which then
// Register pan plugin (depends on Viewport, InteractionManager) - keep disabled to prevent drag panning // permanently locks the viewer in pan mode and blocks all text selection.
createPluginRegistration(PanPluginPackage, {}), createPluginRegistration(PanPluginPackage),
// Register zoom plugin with configuration // Register zoom plugin with configuration
createPluginRegistration(ZoomPluginPackage, { createPluginRegistration(ZoomPluginPackage, {
@@ -300,10 +300,11 @@ export const LocalEmbedPDFWithAnnotations = forwardRef<
selectAfterCreate: true, selectAfterCreate: true,
}), }),
// Register pan plugin // Register pan plugin. Keep the default mode ("never"). Do NOT set
createPluginRegistration(PanPluginPackage, { // defaultMode: "mobile" - it makes pan the default interaction on any
defaultMode: "mobile", // touch-capable device (e.g. Windows touchscreen laptops) and blocks
}), // text selection.
createPluginRegistration(PanPluginPackage),
// Register zoom plugin // Register zoom plugin
createPluginRegistration(ZoomPluginPackage, { createPluginRegistration(ZoomPluginPackage, {