You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using a mantine Popover that opens when I click a button in a table. However, when I click below the table, the popover doesn't close. I investigated a bit and found that shouldIgnore ends up being true within the listeners attached by useClickOutside. This happens because the click event target is the whole page, from <html> to </html>, and this target is not considered part of document.body. Thus, the outside click is ignored.
This is unexpected, right? At least, I'd like for the popover to close when I click below the table. The close behavior works anywhere else on the page, where the click event target does end up as part of document.body
What version of @mantine/hooks page do you have in package.json?
5.8.4
If possible, please include a link to a codesandbox with the reproduced problem
No response
Do you know how to fix the issue
None
Are you willing to participate in fixing this issue and create a pull request with the fix
None
Possible fix
Adjust computation of shouldIgnore. But I'm not sure what the cleanest way to do so would be. I confirmed that removing the document.body.contains(target) check works, but I'm assuming that was put there for a reason?
The text was updated successfully, but these errors were encountered:
What package has an issue
@mantine/hooks
Describe the bug
I'm using a mantine Popover that opens when I click a button in a table. However, when I click below the table, the popover doesn't close. I investigated a bit and found that
shouldIgnore
ends up being true within the listeners attached byuseClickOutside
. This happens because the click event target is the whole page, from<html>
to</html>
, and this target is not considered part ofdocument.body
. Thus, the outside click is ignored.This is unexpected, right? At least, I'd like for the popover to close when I click below the table. The close behavior works anywhere else on the page, where the click event target does end up as part of
document.body
What version of @mantine/hooks page do you have in package.json?
5.8.4
If possible, please include a link to a codesandbox with the reproduced problem
No response
Do you know how to fix the issue
None
Are you willing to participate in fixing this issue and create a pull request with the fix
None
Possible fix
Adjust computation of shouldIgnore. But I'm not sure what the cleanest way to do so would be. I confirmed that removing the
document.body.contains(target)
check works, but I'm assuming that was put there for a reason?The text was updated successfully, but these errors were encountered: