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

Function isFocusable

packages/react-aria/src/utils/isFocusable.ts:40–46  ·  view source on GitHub ↗
(element: Element, options?: {skipVisibilityCheck?: boolean})

Source from the content-addressed store, hash-verified

38const TABBABLE_ELEMENT_SELECTOR = focusableElements.join(':not([hidden]):not([tabindex="-1"]),');
39
40export function isFocusable(element: Element, options?: {skipVisibilityCheck?: boolean}): boolean {
41 return (
42 element.matches(FOCUSABLE_ELEMENT_SELECTOR) &&
43 !isInert(element) &&
44 (options?.skipVisibilityCheck || isElementVisible(element))
45 );
46}
47
48export function isTabbable(element: Element): boolean {
49 return (

Callers 8

Pressable.tsxFile · 0.90
preventFocusFunction · 0.90
useFocusable.tsxFile · 0.90
willOpenKeyboardFunction · 0.90
DropZone.tsxFile · 0.90
PromptFieldContainerFunction · 0.90
acceptNodeFunction · 0.90

Calls 2

isElementVisibleFunction · 0.90
isInertFunction · 0.85

Tested by

no test coverage detected