How to preserve the focus order when fields are rendered conditionally? #12417
Unanswered
cflorez-nex
asked this question in
Q&A
Replies: 0 comments
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.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm having the issue mentioned in this thread: https://github.com/orgs/react-hook-form/discussions/7523?sort=new
when I render inputs conditionally, the focus order is not preserved, in the following stackblitz you could see the error, to reproduce it you could follow these steps:
firstname
will be focusedfirstname
inputadd details
checkbox, two new fields will be renderedgender
anddateOfBirth
lastname
field instead of thegender
inputWhat I expect is, the focus respect the UI input order.
@bluebill1049 @Moshyfawn could you shed some light here :)
Beta Was this translation helpful? Give feedback.
All reactions