One tab stop for a set of items (a toolbar, a tab list, a listbox): arrows
move focus between them, the rest stay out of the tab order. The current
item's id is the Model slice, so a reorder keeps the same item current and a
resumed page knows where focus was. Which item comes next is a pure
function of the items and the key; the Behavior wires it to the slots.
Wires a placed RovingTabindex to the slots: the container's arrow, Home
and End keys (keys) focus the next item (synchronously, then dispatch), each item
gets tabindex 0 or -1 and reports Focused when focused. Under virtual
DOM focus never leaves the container: the key only dispatches, the
container carries aria-activedescendant, and items keep no tabindex.
Every handled key is default-prevented. Nothing is written on dispose: the
attributes are data, so a view that no longer attaches this leaves no
tabindex behind.
An attribute selector for any id: #id throws or misses for ids such as
a:b or 1-x. Quotes, backslashes and control characters are written as
hex escapes, since a raw newline in a CSS string makes querySelector throw.
The attributes one item gets: tabindex 0 when it holds the tab stop and
-1 otherwise (none under virtual), and OnFocus reporting it current.
Shared with ListNavigation.
The route a RovingTabindex installs on its container: the arrows of the
orientation, Home and End, each answering Focused and moving focus to the
item (under virtual, only the Message). List it in a Keys.behavior beside
routes of your own, as behavior lists it alone.
The index the key moves to from current, over the enabled indices only, or
undefined when the key is not a navigation key here. current may be
-1 (nothing current yet): arrows then land on the first or last enabled
item. Under rtl, left and right swap. PageUp and PageDown move by page
and clamp at the ends, never wrapping.