Skip to content

Commit

Permalink
Fix BooleanControl special case
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFarmer committed May 20, 2024
1 parent abd744c commit fac3611
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/controls/BooleanControl.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import {
ControlProps as JSFControlProps,
ControlProps,
isDescriptionHidden,
} from "@jsonforms/core"
import { Form } from "antd"
import { Form, FormItemProps } from "antd"
import { Checkbox } from "../antd/Checkbox"
import { ControlUISchema } from "../ui-schema"
import { withJsonFormsControlProps } from "@jsonforms/react"

type ControlProps = Omit<JSFControlProps, "uischema"> & { uischema: ControlUISchema<unknown> | JSFControlProps["uischema"] }

export function BooleanControl({
data,
visible,
Expand Down Expand Up @@ -45,7 +42,7 @@ export function BooleanControl({
const showTooltip =
!showDescription && !isDescriptionHidden(visible, description, true, true)
const formItemProps =
"formItemProps" in uischema ? uischema.formItemProps : {}
"formItemProps" in uischema ? uischema.formItemProps as FormItemProps : {}
const tooltip = showTooltip && description ? description : undefined

return (
Expand Down

0 comments on commit fac3611

Please sign in to comment.