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

Modal closeOnClickOutside not working #2458

Closed
hunterwilhelm opened this issue Sep 15, 2022 · 5 comments
Closed

Modal closeOnClickOutside not working #2458

hunterwilhelm opened this issue Sep 15, 2022 · 5 comments

Comments

@hunterwilhelm
Copy link
Contributor

hunterwilhelm commented Sep 15, 2022

What package has an issue

@mantine/core

Describe the bug

closeOnClickOutside is no longer working for the Modal component.

Perhaps caused by this bug fix?
92305e2

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

5.3.2

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

https://codesandbox.io/s/mantine-modal-closeonclickoutside-bug-f12rek

Do you know how to fix the issue

No

@rickmoens
Copy link

rickmoens commented Sep 16, 2022

Indeed it is caused by setting the z-index to -1 in 92305e2.

@hunterwilhelm hunterwilhelm changed the title Modal Modal closeOnClickOutside not working Sep 16, 2022
@DaniloHP
Copy link

Yep, noticed this too. You can even see it in the docs for Modal. This specific example actually soft locks the page because esc to close modal doesn't seem to be working either so there's no way to close that modal! This is pretty urgent IMO

@rickmoens
Copy link

A fix is to set the z-index of the inner element to -1 and revert the z-index of the overlay element. The scroll bar can then be used again, the only downside is that it is behind the overlay. See the Codesandbox.

@rtivital
Copy link
Member

Fixed in 5.3.3

@chingiz19
Copy link

I think bug is back at least on 5.9.5

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

5 participants