Keep the application's focus in step with arrow-key moves in forms

Form.SetFocus moves between items without telling the application, which
kept the item that was left. Opening the help from the Config view then
blurred only that one: the field in use kept drawing its cursor through
the help window, the form still had the focus and took the help's keys
(no scrolling), and closing the help returned to the wrong field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019reK4DUGYqDUjniWYJvwUW
This commit is contained in:
2026-10-21 12:23:00 +02:00
co-authored by Claude Opus 5.5
parent 8ce7bdaaa7
commit c3eca0b68c
4 changed files with 52 additions and 2 deletions
+1
View File
@@ -200,6 +200,7 @@ func New(cfg *config.Config) *App {
return false
})
a.app.SetRoot(&toastRoot{Flex: layout, app: a}, true).EnableMouse(false)
syncFocus = func(p tview.Primitive) { a.app.SetFocus(p) }
a.app.SetInputCapture(a.handleKey)
a.switchTo(0)
a.renderServices()