From 339fd50cb9c7cd7bd9164b3260260f5dd8742373 Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" <219766164+opencode-agent[bot]@users.noreply.github.com> Date: Mon, 13 Jul 2026 14:54:59 +0200 Subject: [PATCH] fix(tui): preserve modal focus across dialog replacement (#36656) Co-authored-by: Simon Klee <52795+simonklee@users.noreply.github.com> Co-authored-by: opencode-agent[bot] --- packages/tui/src/ui/dialog.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/tui/src/ui/dialog.tsx b/packages/tui/src/ui/dialog.tsx index ee7d546b98..e98da46453 100644 --- a/packages/tui/src/ui/dialog.tsx +++ b/packages/tui/src/ui/dialog.tsx @@ -90,6 +90,7 @@ function init() { let focus: Renderable | null function refocus() { setTimeout(() => { + if (store.stack.length > 0) return if (!focus) return if (focus.isDestroyed) return function find(item: Renderable) {