MCPcopy
hub / github.com/adobe/react-spectrum / isFocusable

Function isFocusable

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

Source from the content-addressed store, hash-verified

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

Callers 7

Pressable.tsxFile · 0.90
preventFocusFunction · 0.90
useFocusable.tsxFile · 0.90
DropZone.tsxFile · 0.90
PromptFieldFunction · 0.90
acceptNodeFunction · 0.90

Calls 2

isElementVisibleFunction · 0.90
isInertFunction · 0.85

Tested by

no test coverage detected