mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 09:57:02 +01:00
Remove legacy node parent detection (#12814)
This commit is contained in:
parent
5dd86d32bf
commit
df6db8cfef
@ -39,10 +39,9 @@ export default class MenuDroppoComponent extends Component {
|
||||
if (
|
||||
this.props.isOpen &&
|
||||
target !== container &&
|
||||
!isDescendant(this.container, event.target) &&
|
||||
this.props.onClickOutside
|
||||
!this.container.contains(event.target)
|
||||
) {
|
||||
this.props.onClickOutside(event);
|
||||
this.props.onClickOutside?.(event);
|
||||
}
|
||||
};
|
||||
|
||||
@ -117,15 +116,3 @@ export default class MenuDroppoComponent extends Component {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function isDescendant(parent, child) {
|
||||
let node = child.parentNode;
|
||||
while (node !== null) {
|
||||
if (node === parent) {
|
||||
return true;
|
||||
}
|
||||
node = node.parentNode;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user