Skip to content

Commit bbf154b

Browse files
committed
fix type
1 parent 0560e1f commit bbf154b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/mui-utils/src/getActiveElement/getActiveElement.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
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
@@ -17,7 +17,7 @@
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) {

0 commit comments

Comments
 (0)