From 7a8c3e173e614af2c0b9dd7144c97564ec7abfaf Mon Sep 17 00:00:00 2001 From: Oskar Kupski Date: Mon, 15 Apr 2024 12:17:07 +0200 Subject: [PATCH] exposed `scrollIntoView()` to ref created via `useController()` --- src/useController.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/useController.ts b/src/useController.ts index 9f81698a347..1d2295a1187 100644 --- a/src/useController.ts +++ b/src/useController.ts @@ -157,6 +157,8 @@ export function useController< if (field && elm) { field._f.ref = { focus: () => elm.focus(), + scrollIntoView: (arg?: boolean | Record) => + elm.scrollIntoView(arg), select: () => elm.select(), setCustomValidity: (message: string) => elm.setCustomValidity(message),