File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
packages/mui-utils/src/getActiveElement Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 55 * the shadow host element. This function recursively traverses shadow roots to find
66 * the actual focused element.
77 *
8- * @param root - The document to query for the active element .
8+ * @param root - The document or shadow root to start the search from .
99 * @returns The actual focused element, or null if no element has focus.
1010 *
1111 * @example
1717 * // Starting from a specific document
1818 * const activeElement = getActiveElement(ownerDocument(element));
1919 */
20- export default function activeElement ( doc : Document ) : Element | null {
20+ export default function activeElement ( doc : Document | ShadowRoot ) : Element | null {
2121 let element = doc . activeElement ;
2222
2323 while ( element ?. shadowRoot ?. activeElement != null ) {
You can’t perform that action at this time.
0 commit comments