remove operação remove, corrige bug de focus

This commit is contained in:
2026-09-08 11:16:15 -03:00
parent bf46c56b36
commit 94833d6f43
5 changed files with 128 additions and 38 deletions
+5 -1
View File
@@ -272,7 +272,11 @@ func (a *App) buildControls(ctx context.Context) {
func (a *App) globalKeys(ctx context.Context) func(*tcell.EventKey) *tcell.EventKey {
return func(event *tcell.EventKey) *tcell.EventKey {
if name, _ := a.pages.GetFrontPage(); name != pageMain {
// A dialog is open; it handles its own keys.
// A dialog is open. Restore focus to its modal layer before
// dispatch so keys can never reach a page underneath it.
if page := a.pages.GetPage(name); page != nil && !page.HasFocus() {
a.app.SetFocus(page)
}
return event
}
switch event.Key() {