Commit 80bd954
committed
fix(live-preview): don't steal editor focus on iframe click in design mode
In design mode the editor area is collapsed, so pulling focus into it
when the user clicks/Escapes inside the live preview or markdown viewer
iframe is disorienting. Gate all such focus-shift paths on
WorkspaceManager.isInDesignMode():
- _focusEditorIfNeeded and the no-liveDoc fallback in LiveDevProtocol
(HTML live preview edit/highlight click flow)
- focusActiveEditorIfFocusInLivePreview helper (md viewer preview-mode
click, md viewer Escape, HTML iframe Escape)
Cursor positioning is preserved so the cursor still lands correctly if
the user later switches out of design mode.1 parent 11b99a0 commit 80bd954
2 files changed
Lines changed: 12 additions & 2 deletions
File tree
- src
- LiveDevelopment/MultiBrowserImpl/protocol
- extensionsIntegrated/Phoenix-live-preview
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
189 | 190 | | |
190 | 191 | | |
191 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
192 | 196 | | |
193 | 197 | | |
194 | 198 | | |
| |||
247 | 251 | | |
248 | 252 | | |
249 | 253 | | |
250 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
251 | 257 | | |
252 | 258 | | |
253 | 259 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
| |||
0 commit comments