From 77fb766d70e3fa6e1a9ea082ed27c77a9464f901 Mon Sep 17 00:00:00 2001 From: wuxh Date: Fri, 30 Jun 2023 18:39:44 +0800 Subject: [PATCH] fix: support passing in `title=null` to hide the header --- .../src/DraggableModalInner.tsx | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/packages/ant-design-draggable-modal/src/DraggableModalInner.tsx b/packages/ant-design-draggable-modal/src/DraggableModalInner.tsx index 229c518..80fdb9a 100644 --- a/packages/ant-design-draggable-modal/src/DraggableModalInner.tsx +++ b/packages/ant-design-draggable-modal/src/DraggableModalInner.tsx @@ -73,15 +73,20 @@ function DraggableModalInnerNonMemo({ const onMouseResize = useResize(x, y, width, height, onResizeWithID) const titleElement = useMemo( - () => ( -
- {title} -
- ), + () => { + if (title) { + return ( +
+ {title} +
+ ) + } + return title + }, [onMouseDrag, onFocus, title], )