Keynav works flawlessly

This commit is contained in:
2023-01-16 12:21:47 -05:00
parent 354d5f205d
commit fb0795ec7b
4 changed files with 37 additions and 37 deletions

View File

@@ -79,6 +79,17 @@ const (
SelectionDirectionForward SelectionDirection = 1
)
// Canon returns a well-formed direction.
func (direction SelectionDirection) Canon () (canon SelectionDirection) {
if direction > 0 {
return SelectionDirectionForward
} else if direction == 0 {
return SelectionDirectionNeutral
} else {
return SelectionDirectionBackward
}
}
// Selectable represents an element that has keyboard navigation support. This
// includes inputs, buttons, sliders, etc. as well as any elements that have
// children (so keyboard navigation events can be propagated downward).