From dbb9fc694014d185db990b5da8d6a689478e353f Mon Sep 17 00:00:00 2001 From: raziman Date: Fri, 24 Jul 2020 15:22:50 +0800 Subject: [PATCH] fix blocking tab key if popup shows up --- start.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/start.go b/start.go index 9e4090b..33dfdd7 100644 --- a/start.go +++ b/start.go @@ -144,11 +144,18 @@ func start(application *tview.Application, args Args) { application.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { + popupName, _ := gomu.pages.GetFrontPage() + + // disables keybindings when writing in input fields + if strings.Contains(popupName, "-input-") { + return event + } + switch event.Key() { // cycle through each section case tcell.KeyTAB: - if gomu.pages.GetPageCount() > 1 { + if strings.Contains(popupName, "confirmation-") { return event } @@ -156,13 +163,6 @@ func start(application *tview.Application, args Args) { } - name, _ := gomu.pages.GetFrontPage() - - // disables keybindings when writing in input fields - if strings.Contains(name, "-input-") { - return event - } - switch event.Rune() { case 'q':