Skip to content

Commit

Permalink
Missed one
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFarmer committed May 20, 2024
1 parent d377b30 commit 805b98d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/controls/NumericControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import { InputNumber } from "../antd/InputNumber"
import { ControlUISchema } from "../ui-schema"
import { withJsonFormsControlProps } from "@jsonforms/react"

export const NumericControl = (props: ControlProps & RendererProps) => {
type NumericControlProps = ControlProps & RendererProps & {
uischema: ControlUISchema<unknown> | ControlElement
}

export const NumericControl = (props: NumericControlProps) => {
if (!props.visible) return null

const initialValue =
Expand All @@ -19,9 +23,8 @@ export const NumericControl = (props: ControlProps & RendererProps) => {
{ required: props.required, message: `${props.label} is required` },
]

const uiSchema = props.uischema as ControlUISchema<unknown> | ControlElement
const formItemProps =
"formItemProps" in uiSchema ? uiSchema.formItemProps : {}
"formItemProps" in props.uischema ? props.uischema.formItemProps : {}

return (
<Form.Item
Expand Down

0 comments on commit 805b98d

Please sign in to comment.