Skip to content

Commit

Permalink
fix(modal): cleanup scroll-doctor lock on unmount
Browse files Browse the repository at this point in the history
  • Loading branch information
Jostein Kringlen committed Feb 28, 2023
1 parent d479592 commit 74a5c89
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/modal/src/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export const Modal = ({
teardown();
if (!contentRef.current) return;
props.open && setup(contentRef.current);

return () => {
teardown();
};
}, [props.open, contentRef]);

useEffect(() => {
Expand Down

0 comments on commit 74a5c89

Please sign in to comment.