Skip to content

Commit

Permalink
πŸ›(react) fix closeOnClickOutside not working
Browse files Browse the repository at this point in the history
Our recent changes to enable the customization of the modal backdrop
caused this prop to not work anymore.
  • Loading branch information
NathanVss committed Feb 21, 2024
1 parent 3ef7744 commit a17c805
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/react/src/components/Modal/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
// ::backdrop does not inherit from its element so CSS vars does not work.
// ( https://stackoverflow.com/a/77393321 )
// So for now, we hide the backdrop element and use a dom element to create the backdrop.
visibility: hidden;
// We cannot use visibility: hidden because the component will not be able to receive click events for the
// closeOnClickOutside prop. The backdrop is the only element able to capture click as the dialog is displayed in
// the Top-Layer.
background: transparent;
}

&__backdrop {
Expand Down

0 comments on commit a17c805

Please sign in to comment.