fix: select field to display blank when data is empty (#5762)

This commit is contained in:
Katherine 2024-12-01 21:36:05 +08:00 committed by GitHub
parent b59d53dde8
commit 05ed11eb15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -41,15 +41,15 @@ export const ReadPretty = observer(
if (isArrayField(field) && field?.value?.length === 0) {
return <div />;
}
return (
<div>
<EllipsisWithTooltip ellipsis={props.ellipsis}>
{currentOptions.map((option, key) => (
<Tag key={key} color={option[fieldNames.color]} icon={option.icon}>
{option[fieldNames.label]}
</Tag>
))}
{field.value &&
currentOptions.map((option, key) => (
<Tag key={key} color={option[fieldNames.color]} icon={option.icon}>
{option[fieldNames.label]}
</Tag>
))}
</EllipsisWithTooltip>
</div>
);