()
| 83 | |
| 84 | let focus: Renderable | null |
| 85 | function refocus() { |
| 86 | setTimeout(() => { |
| 87 | if (!focus) return |
| 88 | if (focus.isDestroyed) return |
| 89 | function find(item: Renderable) { |
| 90 | for (const child of item.getChildren()) { |
| 91 | if (child === focus) return true |
| 92 | if (find(child)) return true |
| 93 | } |
| 94 | return false |
| 95 | } |
| 96 | const found = find(renderer.root) |
| 97 | if (!found) return |
| 98 | focus.focus() |
| 99 | }, 1) |
| 100 | } |
| 101 | |
| 102 | useBindings(() => ({ |
| 103 | enabled: store.stack.length > 0 && !renderer.getSelection()?.getSelectedText(), |