From df03c1f7f4a8ff0bb8a350e5960c13aac65516ee Mon Sep 17 00:00:00 2001 From: steveoh Date: Wed, 18 Dec 2024 15:59:25 -0700 Subject: [PATCH] fix(textfield): allow input props to be passed through refs #396 --- packages/utah-design-system/src/components/TextField.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/utah-design-system/src/components/TextField.tsx b/packages/utah-design-system/src/components/TextField.tsx index 5fc0976b..bdffb93c 100644 --- a/packages/utah-design-system/src/components/TextField.tsx +++ b/packages/utah-design-system/src/components/TextField.tsx @@ -2,6 +2,7 @@ import { type ForwardedRef, forwardRef } from 'react'; import { TextField as AriaTextField, type TextFieldProps as AriaTextFieldProps, + type InputProps, type ValidationResult, } from 'react-aria-components'; import { tv } from 'tailwind-variants'; @@ -27,10 +28,11 @@ export interface TextFieldProps extends AriaTextFieldProps { label?: string; description?: string; errorMessage?: string | ((validation: ValidationResult) => string); + inputProps?: InputProps; } export const TextField = forwardRef(function TextField( - { label, description, errorMessage, ...props }: TextFieldProps, + { label, description, errorMessage, inputProps, ...props }: TextFieldProps, ref: ForwardedRef, ) { return ( @@ -42,7 +44,7 @@ export const TextField = forwardRef(function TextField( )} > {label && } - + {description && {description}} {errorMessage}