fix: radio (#3701)
This commit is contained in:
parent
c7cfeec6a1
commit
ff1877ce01
@ -40,10 +40,11 @@ Radio.Group = connect(
|
|||||||
const field = useField<any>();
|
const field = useField<any>();
|
||||||
const collectionField = useCollectionField();
|
const collectionField = useCollectionField();
|
||||||
const dataSource = field.dataSource || collectionField?.uiSchema.enum || [];
|
const dataSource = field.dataSource || collectionField?.uiSchema.enum || [];
|
||||||
|
const val = value ? props.value.toString() : value;
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{dataSource
|
{dataSource
|
||||||
.filter((option) => option.value === value)
|
.filter((option) => option.value === val)
|
||||||
.map((option, key) => (
|
.map((option, key) => (
|
||||||
<Tag key={key} color={option.color} icon={option.icon}>
|
<Tag key={key} color={option.color} icon={option.icon}>
|
||||||
{option.label}
|
{option.label}
|
||||||
|
Loading…
Reference in New Issue
Block a user