Skip to content

Commit

Permalink
fix(ui): parse json input value correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
ascariandrea committed Jul 17, 2024
1 parent dd0a073 commit d3fc458
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/@liexp/ui/src/components/Common/JSON/JSONInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ const JSONInput: React.FC<JSONInputProps> = ({
}) => {
const {
field: { value, onChange },
} = useInput({ ...props, source, defaultValue: props.defaultValue ?? "" });
} = useInput({
...props,
format: (v) => (v === "" ? null : v),
source,
defaultValue: props.value ?? props.defaultValue ?? null,
});

return (
<Labeled label={label} fullWidth>
Expand Down

0 comments on commit d3fc458

Please sign in to comment.