Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onPopupMouseLeave = e => {
// https://github.com/react-component/trigger/pull/13
// react bug?
if (
e.relatedTarget &&
!e.relatedTarget.setTimeout &&
this.popupRef.current &&
this.popupRef.current.popupRef.current &&
contains(this.popupRef.current.popupRef.current, e.relatedTarget)
) {
return;
}
this.delaySetPopupVisible(false, this.props.mouseLeaveDelay);
};
onPopupMouseLeave(e) {
// https://github.com/react-component/trigger/pull/13
// react bug?
if (e.relatedTarget && !e.relatedTarget.setTimeout &&
this._component &&
contains(this._component.getPopupDomNode(), e.relatedTarget)) {
return;
}
this.delaySetPopupVisible(false, this.props.mouseLeaveDelay);
},
handleDocumentClick(e) {
// If the click originated from within this component
// don't do anything.
if (contains(ReactDOM.findDOMNode(this), e.target)) {
return;
}
const props = this.props;
props.onItemHover({
hover: false,
item: this,
key: this.props.eventKey,
});
this.triggerOpenChange(false);
},
tryFocus() {
if (!contains(this.wrap, document.activeElement)) {
this.lastOutSideFocusNode = document.activeElement as HTMLElement;
this.sentinelStart.focus();
}
}
onDocumentClick(event) {
if (this.props.mask && !this.props.maskClosable) {
return;
}
const target = event.target;
const root = findDOMNode(this);
const popupNode = this.getPopupDomNode();
if (!contains(root, target) && !contains(popupNode, target)) {
this.close();
}
},
onDocumentClick = event => {
if (this.props.mask && !this.props.maskClosable) {
return;
}
const { target } = event;
const root = this.getRootDomNode();
if (!contains(root, target) && !this.hasPopupMouseDown) {
this.close();
}
};
const pd = (e) => {
if (!element || !contains(element, e.target)) {
e.preventDefault();
}
};
document.body.addEventListener('touchmove', pd, false);