clui: NextControl() also filter out disabled controls

When selecting previous or next controls in we want to also filter
out the disabled controls - since they will never get focused.
This commit is contained in:
Leandro Dorileo 2018-04-18 16:27:48 -07:00
parent 212c6b3a41
commit 0b2b6067c1

View File

@ -203,7 +203,7 @@ func getLinearControlList(parent Control, fn func(Control) bool) []Control {
// that has tab-stop feature on. Used by library when processing TAB key
func NextControl(parent Control, curr Control, next bool) Control {
fnTab := func(c Control) bool {
return c.TabStop() && c.Visible()
return c.TabStop() && c.Visible() && c.Enabled()
}
linear := getLinearControlList(parent, fnTab)