From 235fe92771ca4d51f3171d72ae9eee37f3b3edd8 Mon Sep 17 00:00:00 2001 From: MingLiang Wang Date: Wed, 28 Dec 2022 15:02:01 +0800 Subject: [PATCH] feat: fix show content when loading --- packages/app/src/ui/button/button.tsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/app/src/ui/button/button.tsx b/packages/app/src/ui/button/button.tsx index def9211503..0434ee5331 100644 --- a/packages/app/src/ui/button/button.tsx +++ b/packages/app/src/ui/button/button.tsx @@ -43,14 +43,16 @@ export const Button = forwardRef( {loading ? ( ) : ( - icon && - cloneElement(Children.only(icon), { - width: iconSize, - height: iconSize, - className: `affine-button-icon ${icon.props.className ?? ''}`, - }) + <> + {icon && + cloneElement(Children.only(icon), { + width: iconSize, + height: iconSize, + className: `affine-button-icon ${icon.props.className ?? ''}`, + })} + {children && {children}} + )} - {children && {children}} ); }