mirror of
https://github.com/mastodon/mastodon.git
synced 2026-10-02 11:48:21 -05:00
Fix modals unintentionally closing when clicking on menu items (#40758)
This commit is contained in:
@@ -61,9 +61,11 @@ class ModalRoot extends PureComponent {
|
||||
|
||||
handleBackgroundClick = (e) => {
|
||||
// Close modal, but only when clicking outside of the modal's content
|
||||
if (!e.target.matches('.modal-root__container *')) {
|
||||
this.props.onClose();
|
||||
if (e.target.matches('.modal-root__container *') || !e.target.matches('.modal-root *')) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.props.onClose();
|
||||
}
|
||||
|
||||
componentDidMount () {
|
||||
|
||||
Reference in New Issue
Block a user