Skip to main content

getLastFocusableChild

If you need access to the last focusable descendant of a container, you can use getLastFocusableChild. 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 { getLastFocusableChild } from '@dynatrace/strato-components-preview/core';

Use cases

CodeSandbox
Still have questions?
Find answers in the Dynatrace Community