Disable browser scroll to errored input

When I submit form and the form has errors, like empty required input, browser scrolls up to that input. I dont want that. I have custom scroll to errored inputs and browsers scroll interfere with mine. How to disable this?

btw I use react-hook-form


When you create your form with the useForm hook you just need to set the shouldFocusError to false

e.g.

const { register } = useForm({
  // ... other settings
  shouldFocusError: false,
})

ref: https://react-hook-form.com/api/useform