focusFirstFocusable()function
focusFirstFocusable(el: Nullish<Element>): void
| Param | Type | |
|---|---|---|
el | Nullish<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-
HTMLElementnodes, and when the element contains nothing focusable.
Examples
focusFirstFocusable(dialogRef.current);