Skip to content

Commit

Permalink
fix(dialog): fix Dialog children Re-render Cause input cursor error
Browse files Browse the repository at this point in the history
  • Loading branch information
HaixingOoO committed Sep 1, 2023
1 parent c01d37c commit 7ccf107
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface DialogProps extends TdDialogProps, StyledProps {

const Dialog = forwardRef<DialogInstance, DialogProps>((originalProps, ref) => {
const props = useDefaultProps<DialogProps>(originalProps, dialogDefaultProps);
const { children, ...restProps } = props;
const { classPrefix } = useConfig();

const componentCls = `${classPrefix}-dialog`;
Expand All @@ -32,7 +33,7 @@ const Dialog = forwardRef<DialogInstance, DialogProps>((originalProps, ref) => {
const dialogCardRef = useRef<HTMLDivElement>();
const dialogPosition = useRef();
const portalRef = useRef();
const [state, setState] = useSetState<DialogProps>({ isPlugin: false, ...props });
const [state, setState] = useSetState<DialogProps>({ isPlugin: false, ...restProps });
const [local] = useLocaleReceiver('dialog');

const {
Expand Down Expand Up @@ -228,7 +229,9 @@ const Dialog = forwardRef<DialogInstance, DialogProps>((originalProps, ref) => {
onCancel={handleCancel}
onCloseBtnClick={handleClose}
onMouseDown={onDialogMoveStart}
/>
>
{children}
</DialogCard>
</CSSTransition>
</div>
</div>
Expand Down

0 comments on commit 7ccf107

Please sign in to comment.