refactor: select for bool

This commit is contained in:
cha0s 2021-01-30 20:10:14 -06:00
parent 0e5b5ec2ae
commit 33be5cb110

View File

@ -26,16 +26,19 @@ const Literal = ({
const patch = useJsonPatcher();
const valueComponent = (path, type, {value}) => {
switch (type) {
case 'bool':
case 'bool': {
return (
<input
type="checkbox"
<select
onChange={(event) => {
onChange(event, event.target.checked, path);
onChange(event, event.target.value, path);
}}
value={null === value ? false : value}
/>
>
<option value={false}>false</option>
<option value>true</option>
</select>
);
}
case 'expressions':
return (
<Expressions