MCPcopy Create free account
hub / github.com/adobe/react-spectrum / isTabbableRadio

Function isTabbableRadio

packages/react-aria/src/focus/FocusScope.tsx:328–334  ·  view source on GitHub ↗
(element: HTMLInputElement)

Source from the content-addressed store, hash-verified

326}
327
328function isTabbableRadio(element: HTMLInputElement): boolean {
329 if (element.checked) {
330 return true;
331 }
332 const radios = getRadiosInGroup(element);
333 return radios.length > 0 && !radios.some(radio => radio.checked);
334}
335
336function useFocusContainment(scopeRef: RefObject<Element[] | null>, contain?: boolean) {
337 let focusedNode = useRef<FocusableElement>(undefined);

Callers 1

acceptNodeFunction · 0.85

Calls 1

getRadiosInGroupFunction · 0.85

Tested by

no test coverage detected