Skip to content

Conversation

@y-solb
Copy link

@y-solb y-solb commented Apr 9, 2025

What

Fixes an issue where modal={false} had no effect when using a controlled open prop.

Why

Internally, the modal check only applied on initial mount. When controlling the drawer state using the open prop, pointer events were not correctly restored on open.

How

Added isOpen as a dependency to the useEffect that applies pointer-events: auto when modal is false.

Related

No open issue yet, but related to modal mode accessibility and pointer control.


Thanks for this great library! 😊

@NicHaley
Copy link

Having issues with this too. Anything stopping this from getting merged?

@y-solb
Copy link
Author

y-solb commented Jun 23, 2025

I ran into the same issue and had temporarily worked around it like this:

useEffect(() => {
  requestAnimationFrame(() => {
    document.body.style.pointerEvents = isOpen ? "auto" : "";
  });
}, [isOpen]);

Would love to see this merged! @NicHaley

@fpw23
Copy link

fpw23 commented Oct 8, 2025

Thank you @y-solb this was my exact issue and your suggestion worked perfectly! If anyone else needs this I found the easiest way to fix it is with patch-package. Here is a good post about how to use it.

@bernatfortet
Copy link

Same here!

@ianlet
Copy link

ianlet commented Nov 28, 2025

Thank you @y-solb this was my exact issue and your suggestion worked perfectly! If anyone else needs this I found the easiest way to fix it is with patch-package. Here is a good post about how to use it.

For those using pnpm, there's directly a patch command in the CLI.

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 this pull request may close these issues.

6 participants