Skip to content

Commit

Permalink
Fix onBlur and onFocus not working with FormField. (#3424)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwooding authored and libertymayc committed May 16, 2024
1 parent fe5c364 commit 461aaaf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/khaki-shrimps-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@salt-ds/core": patch
---

Fixed `onBlur` and `onFocus` not working with FormField.
8 changes: 3 additions & 5 deletions packages/core/src/form-field/FormField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export interface FormFieldProps

const withBaseName = makePrefixer("saltFormField");

export const FormField = forwardRef(
export const FormField = forwardRef<HTMLDivElement, FormFieldProps>(
(
{
children,
Expand All @@ -52,13 +52,11 @@ export const FormField = forwardRef(
id: idProp,
labelPlacement = "top",
necessity,
onBlur,
onFocus,
readOnly = false,
validationStatus,
...restProps
}: FormFieldProps,
ref: ForwardedRef<HTMLDivElement>
},
ref
) => {
const targetWindow = useWindow();
useComponentCssInjection({
Expand Down

0 comments on commit 461aaaf

Please sign in to comment.