mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-13 04:53:11 +08:00
fix: Use capture (#28037)
This commit is contained in:
parent
48835b7784
commit
0c8a2eb4ae
@ -1,7 +1,6 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import Dialog from 'rc-dialog';
|
import Dialog from 'rc-dialog';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import addEventListener from 'rc-util/lib/Dom/addEventListener';
|
|
||||||
import CloseOutlined from '@ant-design/icons/CloseOutlined';
|
import CloseOutlined from '@ant-design/icons/CloseOutlined';
|
||||||
|
|
||||||
import useModal from './useModal';
|
import useModal from './useModal';
|
||||||
@ -30,7 +29,7 @@ const getClickPosition = (e: MouseEvent) => {
|
|||||||
|
|
||||||
// 只有点击事件支持从鼠标位置动画展开
|
// 只有点击事件支持从鼠标位置动画展开
|
||||||
if (typeof window !== 'undefined' && window.document && window.document.documentElement) {
|
if (typeof window !== 'undefined' && window.document && window.document.documentElement) {
|
||||||
addEventListener(document.documentElement, 'click', getClickPosition);
|
document.documentElement.addEventListener('click', getClickPosition, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ModalProps {
|
export interface ModalProps {
|
||||||
|
Loading…
Reference in New Issue
Block a user