Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unmounting drawer does not unset position fixed on the <body> #135

Closed
andrejilderda opened this issue Oct 4, 2023 · 0 comments · Fixed by #136
Closed

Unmounting drawer does not unset position fixed on the <body> #135

andrejilderda opened this issue Oct 4, 2023 · 0 comments · Fixed by #136

Comments

@andrejilderda
Copy link
Contributor

Hi @emilkowalski,

Great work on this component!

I'm running into this issue where I'm unable to scroll when the drawer is unmounted without closing.

My use case is that the drawer is opened on a subroute inside a React Router <Outlet />. So if a user is navigating away from this route the drawer is unmounted and any onClose methods are not called, leaving the body scroll lock intact *see below.

Reproduction:
https://codesandbox.io/p/sandbox/body-scroll-lock-bug-on-unmount-2hpk8k?file=%2Fapp%2Fmy-drawer.tsx%3A85%2C21

*Edit: I found that the scroll lock is properly unset, but it's the usePositionFixed-hook that isn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant