fix blocking tab key if popup shows up

This commit is contained in:
raziman 2020-07-24 15:22:50 +08:00
parent decacd991a
commit dbb9fc6940

View File

@ -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':