Commit 588c8b6
fix(settings): use window-level keydown for Escape to close panel
Context: SettingsPanel used `onkeydown` on the panel div, but the div
never receives focus automatically when it opens. Escape key events go
to whatever element has focus (usually the editor), so the handler never
fires.
Solution: Move the Escape handler to `svelte:window onkeydown` so it
captures the key regardless of focus state. Guard with `isOpen` check
to avoid closing when already closed.
Files:
- src/lib/core/settings/SettingsPanel.svelte (77-81,83,86-93): replaced
div-level onkeydown with svelte:window onkeydown, removed tabindex
and a11y ignore comment (no longer needed)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent f93a276 commit 588c8b6
1 file changed
Lines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
84 | 86 | | |
85 | | - | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
92 | | - | |
93 | | - | |
94 | 93 | | |
95 | 94 | | |
96 | 95 | | |
| |||
0 commit comments