Replies: 2 comments
-
I have created a similar Autocomplete component and had similar issues with v7 so this ended up working for onFocusErrors. Most import part for me was this:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
To use setFocus with useController, simply use ref from useController |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
First off, I want to say I LOVE the setFocus functionality. I just saw that was released and immediately upgraded to the latest version of the package.
With that being said, the first use case in which I attempted to use it, it didn't work and I'm guessing it's due to my lack of understanding of how specifically it works.
I have a
FormAutocomplete
component that requires the usage ofuseController
inside of it to register it with the parent component's form. This hasn't posed an issue thus far, but it doesn't seem to work with the setFocus API.In my mind, it works something like this:
useForm
exports thecontrol
useController
with the passed incontrol
to create the necessary information to pass to theFormAutocomplete
so it can be registered with the form.setFocus
method on this autocomplete and nothing happens.The rest of the form's functionality seems to work okay, so I'm guessing it has something to do with the setFocus API and/or my understanding of it.
Can someone provide clarity as to where my thinking/usage is incorrect?
Thanks in advance for your time!
Beta Was this translation helpful? Give feedback.
All reactions