ソースを参照

fix(deck_index): reclaim focus after iframe click so keyboard nav keeps working

After clicking inside a slide iframe, focus moves into the iframe's document
and parent-level keydown stops firing — arrow keys, Space, PgUp/PgDown all
become unresponsive. On window blur, schedule a delayed window.focus() so the
parent reclaims focus once the iframe interaction completes.

Fixes #23

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
alchain 1 ヶ月 前
コミット
9410eef193
1 ファイル変更5 行追加0 行削除
  1. 5 0
      assets/deck_index.html

+ 5 - 0
assets/deck_index.html

@@ -214,6 +214,11 @@
   fit();
   show(current);
 
+  // Reclaim focus after clicking inside iframe so keyboard nav keeps working
+  window.addEventListener('blur', () => {
+    setTimeout(() => window.focus(), 100);
+  });
+
   // Print: build a stack of all iframes so browser prints every slide
   window.addEventListener('beforeprint', () => {
     printStack.innerHTML = '';