diff --git a/src/lib/components/common/PDFViewer.svelte b/src/lib/components/common/PDFViewer.svelte index c8dfaabf35..badbb8ac58 100644 --- a/src/lib/components/common/PDFViewer.svelte +++ b/src/lib/components/common/PDFViewer.svelte @@ -386,6 +386,10 @@ void selectPage(selectedPage + (e.key === 'ArrowUp' || e.key === 'ArrowLeft' ? -1 : 1)); }; + const focusViewer = () => { + if (!outerContainer?.contains(document.activeElement)) outerContainer?.focus(); + }; + const loadPdf = async () => { if (!url && !data) return; @@ -462,9 +466,7 @@ }); - - -
+
{#if loading}
@@ -475,14 +477,17 @@
{/if} -
+
diff --git a/src/lib/components/common/PptxPreview.svelte b/src/lib/components/common/PptxPreview.svelte index d94708ddbf..dc9b54d7a5 100644 --- a/src/lib/components/common/PptxPreview.svelte +++ b/src/lib/components/common/PptxPreview.svelte @@ -121,6 +121,10 @@ } }; + const focusPreview = () => { + if (!rootEl?.contains(document.activeElement)) rootEl?.focus(); + }; + const zoomIn = () => { if (!pzInstance || !stageEl) return; pzInstance.zoomTo(stageEl.clientWidth / 2, stageEl.clientHeight / 2, 1.25); @@ -227,14 +231,15 @@ }); - - -
+