Skip to content

Commit 1f9deb1

Browse files
fix(docsearch): use scrollTo when unmounting modal
1 parent ad3dc51 commit 1f9deb1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/DocSearchModal.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,9 @@ export function DocSearchModal({
279279

280280
return () => {
281281
document.body.classList.remove('DocSearch--active');
282-
document.body.scrollTop = scrollY.current;
282+
// IE11 doesn't support `scrollTo` so we check that the method exists
283+
// first.
284+
window.scrollTo?.(0, scrollY.current);
283285
};
284286
}, []);
285287

0 commit comments

Comments
 (0)