From 05ed11eb1517cc2d220e43ab54d9f343f1d6c2bc Mon Sep 17 00:00:00 2001 From: Katherine Date: Sun, 1 Dec 2024 21:36:05 +0800 Subject: [PATCH] fix: select field to display blank when data is empty (#5762) --- .../src/schema-component/antd/select/ReadPretty.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/select/ReadPretty.tsx b/packages/core/client/src/schema-component/antd/select/ReadPretty.tsx index d70958c05b..9d16d6a6a7 100644 --- a/packages/core/client/src/schema-component/antd/select/ReadPretty.tsx +++ b/packages/core/client/src/schema-component/antd/select/ReadPretty.tsx @@ -41,15 +41,15 @@ export const ReadPretty = observer( if (isArrayField(field) && field?.value?.length === 0) { return
; } - return (
- {currentOptions.map((option, key) => ( - - {option[fieldNames.label]} - - ))} + {field.value && + currentOptions.map((option, key) => ( + + {option[fieldNames.label]} + + ))}
);