From 917fbb1698f3cbd7318c0f3d50a29bcd4c11f2af Mon Sep 17 00:00:00 2001 From: iqingting Date: Tue, 3 Dec 2024 17:17:51 +0800 Subject: [PATCH] fix(theme): support description with a single space using zero-width space --- packages/components/input/src/input.tsx | 4 +++- packages/components/input/stories/input.stories.tsx | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/components/input/src/input.tsx b/packages/components/input/src/input.tsx index 91dadea0e9..e5306a25aa 100644 --- a/packages/components/input/src/input.tsx +++ b/packages/components/input/src/input.tsx @@ -53,7 +53,9 @@ const Input = forwardRef<"input", InputProps>((props, ref) => { {shouldShowError ? (
{errorMessage}
) : ( -
{description}
+
+ {description === " " ? : description} +
)} ); diff --git a/packages/components/input/stories/input.stories.tsx b/packages/components/input/stories/input.stories.tsx index d74a2523a8..43394b8554 100644 --- a/packages/components/input/stories/input.stories.tsx +++ b/packages/components/input/stories/input.stories.tsx @@ -91,6 +91,14 @@ const MirrorTemplate = (args) => ( ); +const WithDescriptionTemplate = (args) => ( +
+ + + +
+); + const FormTemplate = (args) => (