From 461aaafb068fcbca2f4b10610e4ec9b7c40a9526 Mon Sep 17 00:00:00 2001 From: Josh Wooding <12938082+joshwooding@users.noreply.github.com> Date: Thu, 16 May 2024 08:08:24 +0100 Subject: [PATCH] Fix onBlur and onFocus not working with FormField. (#3424) --- .changeset/khaki-shrimps-move.md | 5 +++++ packages/core/src/form-field/FormField.tsx | 8 +++----- 2 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 .changeset/khaki-shrimps-move.md diff --git a/.changeset/khaki-shrimps-move.md b/.changeset/khaki-shrimps-move.md new file mode 100644 index 0000000000..24e0f999e7 --- /dev/null +++ b/.changeset/khaki-shrimps-move.md @@ -0,0 +1,5 @@ +--- +"@salt-ds/core": patch +--- + +Fixed `onBlur` and `onFocus` not working with FormField. diff --git a/packages/core/src/form-field/FormField.tsx b/packages/core/src/form-field/FormField.tsx index cf1af4a675..5f7bb4136b 100644 --- a/packages/core/src/form-field/FormField.tsx +++ b/packages/core/src/form-field/FormField.tsx @@ -43,7 +43,7 @@ export interface FormFieldProps const withBaseName = makePrefixer("saltFormField"); -export const FormField = forwardRef( +export const FormField = forwardRef( ( { children, @@ -52,13 +52,11 @@ export const FormField = forwardRef( id: idProp, labelPlacement = "top", necessity, - onBlur, - onFocus, readOnly = false, validationStatus, ...restProps - }: FormFieldProps, - ref: ForwardedRef + }, + ref ) => { const targetWindow = useWindow(); useComponentCssInjection({