getFirstFocusableChild
If you need access to the first focusable descendant of a container, you can use
getFirstFocusableChild
. The function uses the
https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker to iterate over the
children of the container and returns either a Node
if a focusable element is
found, or null
.
To determine whether a Node
is focusable, the function relies on
isFocusable
.
Import
import { getFirstFocusableChild } from '@dynatrace/strato-components-preview/core';
Use cases
Still have questions?
Find answers in the Dynatrace Community