Buttons now return event nil when the default events are handled
This solves the need for calling ForceDraw in SetSelectedHandler of
button
MODIFY
tview/button.go
tview/button.go
@@ -150,10 +150,12 @@ func (b *Button) InputHandler() InputHandlerFunc {
if b.selected != nil {
b.selected()
}
+ return nil
case tcell.KeyBacktab, tcell.KeyTab, tcell.KeyEscape: // Leave. No action.
if b.blur != nil {
b.blur(key)
}
+ return nil
}
return event

MODIFY
ui/shortcutdialog/dialog.go
ui/shortcutdialog/dialog.go
@@ -42,7 +42,6 @@ func ShowShortcutsDialog(app *tview.Application, onClose func()) {
shortcuts.Persist()
table.SetShortcuts(shortcuts.Shortcuts)
- app.ForceDraw()
})
resetButton.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
if event.Key() == tcell.KeyTab {

MODIFY
ui/window.go
ui/window.go
@@ -1506,7 +1506,6 @@ func (window *Window) ShowDialog(color tcell.Color, text string, buttonHandler f
buttonHandler(newButton.GetLabel())
window.dialogReplacement.SetVisible(false)
window.app.SetFocus(previousFocus)
- window.app.ForceDraw()
})
buttonWidgets = append(buttonWidgets, newButton)

Buttons now return event nil when the default events are handled

This solves the need for calling ForceDraw in SetSelectedHandler of
button