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

Drawer without overlay still prevents interaction with the DOM outside the drawer #2289

Closed
fvaldes33 opened this issue Aug 30, 2022 · 7 comments

Comments

@fvaldes33
Copy link

What package has an issue

@mantine/core

Describe the bug

Just upgraded from 4.x to the latest 5.x version.

Drawers with withOverlay: false before allowed you to interact with the DOM behind the drawer. The drawer root had a height and width of 0px.

Now, even with withOverlay: false the drawer root is fixed and inset 0 which prevents clicks from making it to the dom behind.

What version of @mantine/hooks page do you have in package.json?

5.2

If possible, please include a link to a codesandbox with the reproduced problem

https://codesandbox.io/embed/misty-haze-8jx2p5

Do you know how to fix the issue

Yes

Are you willing to participate in fixing this issue and create a pull request with the fix

Yes

Possible fix

The withOverlay prop should be passed into the createStyles method and alter the output of the root styles.

@nmay231
Copy link
Contributor

nmay231 commented Aug 30, 2022

Probably need withinPortal, but if that doesn't work, please provide a minimal code example in a codesandbox.

@fvaldes33
Copy link
Author

@nmay231 - Even with withinPortal I still see the same behavior. codesandbox below

https://codesandbox.io/embed/misty-haze-8jx2p5

@nmay231
Copy link
Contributor

nmay231 commented Aug 31, 2022

@fvaldes33 Now I understand. You can use the styles API to get the previous behaviour back: styles={{ root: { width: 0, height: 0 } }}.

https://codesandbox.io/s/cocky-torvalds-vbffpz?file=/src/App.tsx:710-752

@fvaldes33
Copy link
Author

@nmay231 - Totally, that is what I ended up doing but, should this be fixed in the library?

@nmay231
Copy link
Contributor

nmay231 commented Sep 1, 2022

It probably should. It doesn't make sense for that behavior when withOverlay={false}. @rtivital ?

@rtivital
Copy link
Member

rtivital commented Sep 2, 2022

Yeah, I think it is a bug, will be fixed in one of next patches, PR is welcome.

@italodeandra
Copy link
Contributor

italodeandra commented Sep 17, 2022

Fixed on #2351 (Release 5.3.2)

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

No branches or pull requests

4 participants