Skip to content

Commit 3506516

Browse files
authored
Merge pull request #178 from JosteinKringlen/main
fix(modal): cleanup scroll-doctor lock on unmount
2 parents d479592 + 74a5c89 commit 3506516

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/modal/src/component.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ export const Modal = ({
2121
teardown();
2222
if (!contentRef.current) return;
2323
props.open && setup(contentRef.current);
24+
25+
return () => {
26+
teardown();
27+
};
2428
}, [props.open, contentRef]);
2529

2630
useEffect(() => {

0 commit comments

Comments
 (0)