Skip to content

Commit

Permalink
exposed scrollIntoView() to ref created via useController()
Browse files Browse the repository at this point in the history
  • Loading branch information
oskarski committed Apr 15, 2024
1 parent 7cdad77 commit 7a8c3e1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/useController.ts
Expand Up @@ -157,6 +157,8 @@ export function useController<
if (field && elm) {
field._f.ref = {
focus: () => elm.focus(),
scrollIntoView: (arg?: boolean | Record<string, string>) =>
elm.scrollIntoView(arg),
select: () => elm.select(),
setCustomValidity: (message: string) =>
elm.setCustomValidity(message),
Expand Down

0 comments on commit 7a8c3e1

Please sign in to comment.