fix: Use capture (#28037)

This commit is contained in:
二货机器人 2020-11-27 15:53:51 +08:00 committed by GitHub
parent 48835b7784
commit 0c8a2eb4ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,6 @@
import * as React from 'react';
import Dialog from 'rc-dialog';
import classNames from 'classnames';
import addEventListener from 'rc-util/lib/Dom/addEventListener';
import CloseOutlined from '@ant-design/icons/CloseOutlined';
import useModal from './useModal';
@ -30,7 +29,7 @@ const getClickPosition = (e: MouseEvent) => {
// 只有点击事件支持从鼠标位置动画展开
if (typeof window !== 'undefined' && window.document && window.document.documentElement) {
addEventListener(document.documentElement, 'click', getClickPosition);
document.documentElement.addEventListener('click', getClickPosition, true);
}
export interface ModalProps {