From c046411087f00a60e69332194fe7ab9bb1eb0761 Mon Sep 17 00:00:00 2001 From: Zong-Ke Zhang <65376724+Zzongke@users.noreply.github.com> Date: Fri, 3 Nov 2023 01:48:30 +0800 Subject: [PATCH] fix(dialog): fix Dialog children Re-render Cause input cursor error (#2485) fix #2484 --- src/dialog/Dialog.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/dialog/Dialog.tsx b/src/dialog/Dialog.tsx index 55405785aa..2016ce1139 100644 --- a/src/dialog/Dialog.tsx +++ b/src/dialog/Dialog.tsx @@ -23,6 +23,7 @@ export interface DialogProps extends TdDialogProps, StyledProps { const Dialog = forwardRef((originalProps, ref) => { const props = useDefaultProps(originalProps, dialogDefaultProps); + const { children, ...restProps } = props; const { classPrefix } = useConfig(); const componentCls = `${classPrefix}-dialog`; @@ -32,7 +33,7 @@ const Dialog = forwardRef((originalProps, ref) => { const dialogCardRef = useRef(); const dialogPosition = useRef(); const portalRef = useRef(); - const [state, setState] = useSetState({ isPlugin: false, ...props }); + const [state, setState] = useSetState({ isPlugin: false, ...restProps }); const [local] = useLocaleReceiver('dialog'); const { @@ -228,7 +229,9 @@ const Dialog = forwardRef((originalProps, ref) => { onCancel={handleCancel} onCloseBtnClick={handleClose} onMouseDown={onDialogMoveStart} - /> + > + {children} +