Skip to main content

Function: radioTabIndex()

radioTabIndex(isSelected, index, hasSelection): number

Defined in: composables/shared/utils/radioGroup.ts:69

Roving tabindex: exactly ONE radio in a group is tabbable, so Tab enters and leaves the group as a single stop and the arrow keys move within it.

The selected option owns the tab stop. With nothing selected yet the first option takes it — otherwise the group would have no tabbable element at all and a keyboard user could never reach it, which is the state checkout starts in.

Parameters

isSelected

boolean

index

number

hasSelection

boolean

Returns

number