summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhaoyuren <13851610112@163.com>2026-03-15 04:30:21 -0500
committerhaoyuren <13851610112@163.com>2026-03-15 04:30:21 -0500
commitba0501dab87f5735cfb1f923ab1a25a6f5a2a3a2 (patch)
tree1731d1edd9633972fa98b22ffec1c0290baf7927 /src
parentd1ee677591bd5e6e8b1726b2281621adf6131332 (diff)
Fix PDF double-click text selection, add user-select: none to PDF container
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'src')
-rw-r--r--src/renderer/src/App.css1
-rw-r--r--src/renderer/src/components/PdfViewer.tsx4
2 files changed, 4 insertions, 1 deletions
diff --git a/src/renderer/src/App.css b/src/renderer/src/App.css
index 4c3f731..d4c5d1f 100644
--- a/src/renderer/src/App.css
+++ b/src/renderer/src/App.css
@@ -1337,6 +1337,7 @@ html, body, #root {
align-items: center;
gap: 8px;
background: #EDE5CE;
+ user-select: none;
}
.pdf-page {
diff --git a/src/renderer/src/components/PdfViewer.tsx b/src/renderer/src/components/PdfViewer.tsx
index 01896d7..c66df98 100644
--- a/src/renderer/src/components/PdfViewer.tsx
+++ b/src/renderer/src/components/PdfViewer.tsx
@@ -214,9 +214,11 @@ export default function PdfViewer() {
// SyncTeX: double-click PDF → jump to source
const handlePdfDoubleClick = useCallback(async (e: MouseEvent) => {
+ e.preventDefault()
+ e.stopPropagation()
if (!pdfPath) { console.log('[synctex-ui] no pdfPath'); return }
const canvas = (e.target as HTMLElement).closest('canvas.pdf-page') as HTMLCanvasElement | null
- if (!canvas) { console.log('[synctex-ui] no canvas target'); return }
+ if (!canvas) { console.log('[synctex-ui] no canvas target, target was:', (e.target as HTMLElement).tagName, (e.target as HTMLElement).className); return }
const container = containerRef.current
if (!container) return