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

Function isTabbableRadio

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

Source from the content-addressed store, hash-verified

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

Callers 1

acceptNodeFunction · 0.85

Calls 1

getRadiosInGroupFunction · 0.85

Tested by

no test coverage detected