From e161ffce57b68ac5eeebf1af77d374107900207d Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 2 Jan 2026 21:20:29 +0200 Subject: [PATCH] fix(client/pdf): not always focusing on click --- .../src/widgets/type_widgets/file/Pdf.tsx | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/apps/client/src/widgets/type_widgets/file/Pdf.tsx b/apps/client/src/widgets/type_widgets/file/Pdf.tsx index c915a0a5d..6c1512d87 100644 --- a/apps/client/src/widgets/type_widgets/file/Pdf.tsx +++ b/apps/client/src/widgets/type_widgets/file/Pdf.tsx @@ -151,25 +151,6 @@ export default function PdfPreview({ note, blob, componentId, noteContext }: { } }, [ blob ]); - // Trigger focus when iframe content is clicked (iframe focus doesn't bubble) - useEffect(() => { - const iframe = iframeRef.current; - if (!iframe) return; - - const handleIframeClick = () => { - if (noteContext.ntxId) { - appContext.tabManager.activateNoteContext(noteContext.ntxId); - } - }; - - // Listen for clicks on the iframe's content window - const iframeDoc = iframe.contentWindow?.document; - if (iframeDoc) { - iframeDoc.addEventListener('click', handleIframeClick); - return () => iframeDoc.removeEventListener('click', handleIframeClick); - } - }, [ iframeRef.current?.contentWindow, noteContext ]); - return (historyConfig &&