Skip to content

Commit

Permalink
Tabbing to widgets properly sets the IsFocused property. Closes #467
Browse files Browse the repository at this point in the history
  • Loading branch information
senorprogrammer committed May 25, 2019
1 parent 7a93824 commit 042f602
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/todo/keyboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

func (widget *Widget) initializeKeyboardControls() {
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help prompt")
widget.SetKeyboardChar(" ", widget.Refresh, "Refresh widget")
widget.SetKeyboardChar("r", widget.Refresh, "Refresh widget")
widget.SetKeyboardChar("j", widget.displayNext, "Select next item")
widget.SetKeyboardChar("k", widget.displayPrev, "Select previous item")
widget.SetKeyboardChar(" ", widget.toggleChecked, "Toggle checkmark")
Expand Down
4 changes: 4 additions & 0 deletions wtf/focus_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ func (tracker *FocusTracker) Next() {
tracker.blur(tracker.Idx)
tracker.increment()
tracker.focus(tracker.Idx)

tracker.IsFocused = true
}

// None removes focus from the currently-focused widget.
Expand All @@ -100,6 +102,8 @@ func (tracker *FocusTracker) Prev() {
tracker.blur(tracker.Idx)
tracker.decrement()
tracker.focus(tracker.Idx)

tracker.IsFocused = true
}

func (tracker *FocusTracker) Refocus() {
Expand Down

0 comments on commit 042f602

Please sign in to comment.