focusFirstFocusable()function

focusFirstFocusable(el: Nullish<Element>): void
ParamType
elNullish<Element>
The container element to focus the first focusable descendant of. required

Focus on the first focusable element inside an element.

  • No-op for nullish input or non-HTMLElement nodes, and when the element contains nothing focusable.

Examples

focusFirstFocusable(dialogRef.current);