From 8ae5b685041021517ad4fd2174c577feea1bc2ad Mon Sep 17 00:00:00 2001 From: zomars Date: Fri, 6 May 2022 16:09:40 -0600 Subject: [PATCH] Adds hint to input --- packages/ui/form/fields.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/ui/form/fields.tsx b/packages/ui/form/fields.tsx index db3b0e41..a54d83aa 100644 --- a/packages/ui/form/fields.tsx +++ b/packages/ui/form/fields.tsx @@ -42,6 +42,7 @@ export function InputLeading(props: JSX.IntrinsicElements["div"]) { type InputFieldProps = { label?: ReactNode; + hint?: ReactNode; addOnLeading?: ReactNode; } & React.ComponentProps & { labelProps?: React.ComponentProps; @@ -59,6 +60,7 @@ const InputField = forwardRef(function InputF : "", className, addOnLeading, + hint, ...passThrough } = props; return ( @@ -82,6 +84,7 @@ const InputField = forwardRef(function InputF ) : ( )} + {hint} {methods?.formState?.errors[props.name] && ( )} @@ -192,6 +195,7 @@ const PlainForm = (props: FormProps, ref: Ref { + event.preventDefault(); form .handleSubmit(handleSubmit)(event) .catch((err) => {