Skip to content

Commit

Permalink
Fix weird behavour on boolean input in layout form #132
Browse files Browse the repository at this point in the history
  • Loading branch information
sim51 committed Jan 31, 2024
1 parent 90a6828 commit ec65ed6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/forms/TypedInputs.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import cx from "classnames";
import { clamp } from "lodash";
import { clamp, isNil } from "lodash";
import Slider from "rc-slider";
import { MarkObj } from "rc-slider/lib/Marks";
import { SliderProps } from "rc-slider/lib/Slider";
Expand Down Expand Up @@ -137,7 +137,7 @@ export const BooleanInput: FC<
type="checkbox"
className={cx("form-check-input", className)}
id={id}
checked={value ?? false}
checked={isNil(value) ? false : value}
onChange={(e) => onChange(e.target.checked)}
/>
<label htmlFor={id} className="form-check-label small ms-1">
Expand Down

0 comments on commit ec65ed6

Please sign in to comment.