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,
}),
// 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, {
@@ -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, {