fix: radio (#3701)

This commit is contained in:
katherinehhh 2024-03-13 12:59:20 +08:00 committed by GitHub
parent c7cfeec6a1
commit ff1877ce01
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -40,10 +40,11 @@ Radio.Group = connect(
const field = useField<any>();
const collectionField = useCollectionField();
const dataSource = field.dataSource || collectionField?.uiSchema.enum || [];
const val = value ? props.value.toString() : value;
return (
<div>
{dataSource
.filter((option) => option.value === value)
.filter((option) => option.value === val)
.map((option, key) => (
<Tag key={key} color={option.color} icon={option.icon}>
{option.label}