Fix modals unintentionally closing when clicking on menu items (#40758)

This commit is contained in:
diondiondion
2026-09-30 08:25:06 +00:00
committed by GitHub
parent e5ec4643cb
commit f1fd7bc523

View File

@@ -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 () {