From 805b98d41e5777b124a05a9f9c115157b3282b44 Mon Sep 17 00:00:00 2001 From: Nathan Farmer Date: Mon, 20 May 2024 12:48:45 -0400 Subject: [PATCH] Missed one --- src/controls/NumericControl.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/controls/NumericControl.tsx b/src/controls/NumericControl.tsx index f5b0a94..e8e15c6 100644 --- a/src/controls/NumericControl.tsx +++ b/src/controls/NumericControl.tsx @@ -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 | ControlElement +} + +export const NumericControl = (props: NumericControlProps) => { if (!props.visible) return null const initialValue = @@ -19,9 +23,8 @@ export const NumericControl = (props: ControlProps & RendererProps) => { { required: props.required, message: `${props.label} is required` }, ] - const uiSchema = props.uischema as ControlUISchema | ControlElement const formItemProps = - "formItemProps" in uiSchema ? uiSchema.formItemProps : {} + "formItemProps" in props.uischema ? props.uischema.formItemProps : {} return (