Fix click event handling when clicking outside of an open dropdown menu (#31251)

This commit is contained in:
Claire 2024-08-01 22:50:36 +02:00 committed by KMY
parent f23993a9fd
commit ab5d9f71d4

View file

@ -39,6 +39,7 @@ class DropdownMenu extends PureComponent {
if (this.node && !this.node.contains(e.target)) { if (this.node && !this.node.contains(e.target)) {
this.props.onClose(); this.props.onClose();
e.stopPropagation(); e.stopPropagation();
e.preventDefault();
} }
}; };