Skip to content
This repository was archived by the owner on Nov 4, 2025. It is now read-only.

Commit d8f82f6

Browse files
author
Jack Yin
authored
fix activeElement.focus throw error in IE (#59)
* fix activeElement.focus throw error in IE * format code
1 parent 1882296 commit d8f82f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function isSamePoint(prev: TargetPoint, next: TargetPoint) {
1919

2020
export function restoreFocus(activeElement, container) {
2121
// Focus back if is in the container
22-
if (activeElement !== document.activeElement && contains(container, activeElement)) {
22+
if (activeElement !== document.activeElement && contains(container, activeElement) && typeof activeElement.focus === 'function') {
2323
activeElement.focus();
2424
}
2525
}

0 commit comments

Comments
 (0)