Skip to content

Commit

Permalink
Fixed UseInput's onBlur type
Browse files Browse the repository at this point in the history
  • Loading branch information
yanchesky committed Feb 12, 2025
1 parent bc137d0 commit bec20f1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/ra-core/src/form/useInput.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReactElement, useEffect } from 'react';
import { ReactElement, useEffect, FocusEvent } from 'react';
import {
ControllerFieldState,
ControllerRenderProps,
Expand All @@ -7,6 +7,7 @@ import {
UseControllerReturn,
UseFormStateReturn,
} from 'react-hook-form';
import type { EditorEvents } from '@tiptap/react';
import get from 'lodash/get';

import { useRecordContext } from '../controller';
Expand Down Expand Up @@ -154,7 +155,11 @@ export type UseInputValue = {
id: string;
isRequired: boolean;
field: Omit<ControllerRenderProps, 'onBlur'> & {
onBlur: (...event: any[]) => void;
onBlur: (
event?:
| FocusEvent<HTMLInputElement | HTMLTextAreaElement>
| EditorEvents['blur']
) => void;
};
formState: UseFormStateReturn<Record<string, string>>;
fieldState: ControllerFieldState;
Expand Down

0 comments on commit bec20f1

Please sign in to comment.