mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-02-07 15:10:45 +03:00
fix(devui): fix Select widget in Form (#722)
This commit is contained in:
parent
bb72311e1c
commit
a8d99ee424
|
@ -4,8 +4,17 @@ import Select from '../Select';
|
||||||
import Slider from '../Slider';
|
import Slider from '../Slider';
|
||||||
|
|
||||||
/* eslint-disable react/prop-types */
|
/* eslint-disable react/prop-types */
|
||||||
const SelectWidget: Widget = ({ options, ...rest }) => (
|
const SelectWidget: Widget = ({ options, onChange, value, ...rest }) => (
|
||||||
<Select options={options.enumOptions} {...rest} />
|
<Select
|
||||||
|
options={options.enumOptions}
|
||||||
|
onChange={(option: { value: string }) => {
|
||||||
|
onChange(option.value);
|
||||||
|
}}
|
||||||
|
value={(options.enumOptions as { value: string }[]).find(
|
||||||
|
(option) => option.value === value
|
||||||
|
)}
|
||||||
|
{...rest}
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
const RangeWidget: Widget = (({
|
const RangeWidget: Widget = (({
|
||||||
|
|
Loading…
Reference in New Issue
Block a user