Skip to content

Commit

Permalink
Cleanup (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilkowalski authored Sep 22, 2023
1 parent 95c3f96 commit 0270960
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,16 @@ function Root({
}
}

React.useEffect(() => {
// Clean up the wrapper styles in case the drawer has been unmounted without closing it
const wrapper = document.querySelector('[vaul-drawer-wrapper]');
if (wrapper) {
return () => {
reset(wrapper);
};
}
}, []);

React.useEffect(() => {
function onVisualViewportChange() {
if (!drawerRef.current) return;
Expand Down

0 comments on commit 0270960

Please sign in to comment.