(ref: R, fallbackElement?: T)
| 26 | * If no fallback is specified then we focus the container itself. |
| 27 | */ |
| 28 | export const focusFirstDescendant = <R extends HTMLElement, T extends HTMLElement>(ref: R, fallbackElement?: T) => { |
| 29 | const firstInput = ref.querySelector<HTMLElement>(focusableQueryString); |
| 30 | |
| 31 | focusElementInContext(firstInput, fallbackElement ?? ref); |
| 32 | }; |
| 33 | |
| 34 | /** |
| 35 | * Focuses the last descendant in a context |
no test coverage detected