Skip to content

Commit 7862665

Browse files
fix: update ant, chakra, mui to use key as the value for SelectField
1 parent 6c47d41 commit 7862665

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/ant/src/components/SelectField.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const SelectField: React.FC<AutoFormFieldProps> = ({
1414
const options =
1515
field.options?.map((option) => ({
1616
label: option[1],
17-
value: option[1],
17+
value: option[0],
1818
})) || [];
1919
return (
2020
<Select

packages/chakra/src/components/autoform/SelectField.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const SelectField: React.FC<AutoFormFieldProps> = ({
2222
items:
2323
field.options?.map((option) => ({
2424
label: option[1],
25-
value: option[1],
25+
value: option[0],
2626
})) || [],
2727
});
2828

packages/mui/src/components/SelectField.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const SelectField: React.FC<AutoFormFieldProps> = ({
1010
}) => (
1111
<Select error={!!error} fullWidth {...inputProps}>
1212
{(field.options || []).map(([key, label]) => (
13-
<MenuItem key={key} value={label}>
13+
<MenuItem key={key} value={key}>
1414
{label}
1515
</MenuItem>
1616
))}

0 commit comments

Comments
 (0)