@etsoo/react 1.5.37 → 1.5.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/mu/OptionGroup.js +2 -1
- package/package.json +1 -1
- package/src/mu/OptionGroup.tsx +2 -1
package/lib/mu/OptionGroup.js
CHANGED
|
@@ -66,12 +66,13 @@ export function OptionGroup(props) {
|
|
|
66
66
|
return (React.createElement(FormControlLabel, { key: value, control: control, value: value, label: label }));
|
|
67
67
|
});
|
|
68
68
|
// Group
|
|
69
|
-
const group = multiple ? (React.createElement(FormGroup, { row: row }, list)) : (React.createElement(RadioGroup, { row: row, name: name, value:
|
|
69
|
+
const group = multiple ? (React.createElement(FormGroup, { row: row }, list)) : (React.createElement(RadioGroup, { row: row, name: name, value: values[0], onChange: (_event, value) => {
|
|
70
70
|
if (firstOptionValue == null)
|
|
71
71
|
return;
|
|
72
72
|
const typeValue = Utils.parseString(value, firstOptionValue);
|
|
73
73
|
if (onValueChange)
|
|
74
74
|
onValueChange(typeValue);
|
|
75
|
+
setValues([typeValue]);
|
|
75
76
|
} }, list));
|
|
76
77
|
// Layout
|
|
77
78
|
return (React.createElement(FormControl, { component: "fieldset", ...rest },
|
package/package.json
CHANGED
package/src/mu/OptionGroup.tsx
CHANGED
|
@@ -194,11 +194,12 @@ export function OptionGroup<
|
|
|
194
194
|
<RadioGroup
|
|
195
195
|
row={row}
|
|
196
196
|
name={name}
|
|
197
|
-
value={
|
|
197
|
+
value={values[0]}
|
|
198
198
|
onChange={(_event, value) => {
|
|
199
199
|
if (firstOptionValue == null) return;
|
|
200
200
|
const typeValue = Utils.parseString<D>(value, firstOptionValue);
|
|
201
201
|
if (onValueChange) onValueChange(typeValue);
|
|
202
|
+
setValues([typeValue]);
|
|
202
203
|
}}
|
|
203
204
|
>
|
|
204
205
|
{list}
|