Skip to content
Discussion options

You must be logged in to vote

@davidalvarezr

You can override focus() method of the DOM element when passing it via "ref" of "register" and perform any custom behaviour for focusing, something like scrollIntoView with smooth option then trigger focus() of the element.

Example of overriding focus() method: https://codesandbox.io/s/setfocus-forked-qqr3zr?file=/src/App.tsx

Replies: 5 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@bluebill1049
Comment options

@davidalvarezr
Comment options

Answer selected by bluebill1049
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
7 participants