refactor: select for bool
This commit is contained in:
parent
0e5b5ec2ae
commit
33be5cb110
|
@ -26,16 +26,19 @@ const Literal = ({
|
||||||
const patch = useJsonPatcher();
|
const patch = useJsonPatcher();
|
||||||
const valueComponent = (path, type, {value}) => {
|
const valueComponent = (path, type, {value}) => {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'bool':
|
case 'bool': {
|
||||||
return (
|
return (
|
||||||
<input
|
<select
|
||||||
type="checkbox"
|
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
onChange(event, event.target.checked, path);
|
onChange(event, event.target.value, path);
|
||||||
}}
|
}}
|
||||||
value={null === value ? false : value}
|
value={null === value ? false : value}
|
||||||
/>
|
>
|
||||||
|
<option value={false}>false</option>
|
||||||
|
<option value>true</option>
|
||||||
|
</select>
|
||||||
);
|
);
|
||||||
|
}
|
||||||
case 'expressions':
|
case 'expressions':
|
||||||
return (
|
return (
|
||||||
<Expressions
|
<Expressions
|
||||||
|
|
Loading…
Reference in New Issue
Block a user