Two-dimensional arrow keys over a set of items laid out in rows of
columns (a calendar grid, a color swatch picker, an emoji palette). The
Model slice is the current item's id, as with RovingTabindex, so a
reorder keeps the same item current. Which cell a key lands on is the pure
move; the Behavior wires it to a container slot and a per-item slot and
shares RovingTabindex's item attributes, so the two are interchangeable
on a view.
Wires a placed GridNavigation to the slots exactly as RovingTabindex
does, with move above deciding the cell: the container's arrows, Home and
End (and PageUp and PageDown, given page) (keys) focus the next cell (synchronously, then dispatch) or, under virtual,
only dispatch and point with aria-activedescendant; each cell gets
tabindex 0 or -1 and reports Focused when focused. routes are the
application's keys on the same container keydown.
The route a GridNavigation installs on its container: the four arrows,
Home and End, and Ctrl+Home and Ctrl+End for the grid's corners, each
answering Focused and moving focus to the cell (under virtual, only the
Message).
The index the key moves to from current over a grid of count cells in
rows of columns, skipping cells not in enabled, or undefined when the
key is not a grid key. Left and right step within the row, and across rows
under wrap; up and down step within the column, and across columns under
wrap. Home and End are the row's first and last enabled cell; with Ctrl
they are the grid's. At an edge without wrap the key is consumed and
current is returned. PageUp and PageDown, when page is given, move that
many rows in the same column and stop at the first or last row, never
wrapping; a disabled landing cell continues in the direction of travel as
the arrows do, and when nothing beyond it is enabled the nearest enabled
cell back toward current is taken, else current. From -1 (nothing
current) a forward key lands on the first enabled cell and a backward key
on the last. Under rtl, left and right swap.