From 317d65397b8c624d08eafe3a012483d210461b86 Mon Sep 17 00:00:00 2001 From: zombiej Date: Sun, 11 Oct 2020 20:18:02 +0800 Subject: [PATCH 1/2] fix: Portal event popup --- examples/ant-design.tsx | 8 +++++++- package.json | 1 + src/Dialog/Content.tsx | 3 +++ src/Dialog/index.tsx | 21 ++++++++++++++++++++- 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/examples/ant-design.tsx b/examples/ant-design.tsx index f7c02103..b4679296 100644 --- a/examples/ant-design.tsx +++ b/examples/ant-design.tsx @@ -1,6 +1,8 @@ /* eslint no-console:0 */ import '../assets/index.less'; import * as React from 'react'; +import Select from 'rc-select'; +import 'rc-select/assets/index.less'; import Dialog from '../src/DialogWrap'; const clearPath = @@ -133,7 +135,11 @@ const MyControl = () => { -
+
+ +
); diff --git a/package.json b/package.json index 132ccf9e..78da623c 100644 --- a/package.json +++ b/package.json @@ -69,6 +69,7 @@ "np": "^6.4.0", "prettier": "^2.1.1", "rc-drawer": "4.1.0", + "rc-select": "^11.4.1", "react": "^16.9.0", "react-dom": "^16.9.0", "react-draggable": "^4.4.3", diff --git a/src/Dialog/Content.tsx b/src/Dialog/Content.tsx index 727130b9..b4979edf 100644 --- a/src/Dialog/Content.tsx +++ b/src/Dialog/Content.tsx @@ -11,6 +11,7 @@ export interface ContentProps extends IDialogChildProps { motionName: string; ariaId: string; onVisibleChanged: (visible: boolean) => void; + onClick: React.MouseEventHandler; } export interface ContentRef { @@ -41,6 +42,7 @@ const Content = React.forwardRef((props, ref) => { ariaId, onClose, onVisibleChanged, + onClick, mousePosition, } = props; @@ -142,6 +144,7 @@ const Content = React.forwardRef((props, ref) => { ref={motionRef} style={{ ...motionStyle, ...style, ...contentStyle }} className={classNames(prefixCls, className, motionClassName)} + onClick={onClick} >