Replies: 6 comments 6 replies
-
That code snippet did not look too great. Here is a screenshot of the same code |
Beta Was this translation helpful? Give feedback.
-
bump |
Beta Was this translation helpful? Give feedback.
-
react hook form has no control over tab order. |
Beta Was this translation helpful? Give feedback.
-
@bluebill1049 But rhf most definitely affects focus, which ends up affecting the ability to tab / tab order. I'm experiencing the same issue as @ragnsan. Maybe setFocus from useForm can help, if you specify the next input/field. Im trying to use it after using trigger to do manual validation on one field in the form |
Beta Was this translation helpful? Give feedback.
-
@bluebill1049 But rhf most definitely affects focus, which ends up affecting the ability to tab / tab order. I'm experiencing the same issue as @ragnsan. Maybe setFocus .from useForm can help, if you specify the next input/field. Im trying to use it after using trigger to do manual validation on one field in the form |
Beta Was this translation helpful? Give feedback.
-
Has anybody found a solution for this problem? This still occurs on version |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! I was wondering if anyone could help me out.
Tabbing through my form when it initially opens perfectly. But if I try to submit the form to get an error message, fill in the missing field, and then tab, it does not tab into the next input field. Instead, it unfocuses. When I tab once more, it selects the first element in the form modal, an "x"-button. If I keep tabbing, I can get back to the input I corrected and continue filling out the form. Whenever I get to another form field that threw a required error, the same thing happens. It resets the tab order and you have to start over. Here is a sample input field from the form:
<div className="flex flex-col flex-1 "> <label htmlFor="product" className={
${!errors.name
? "text-primary_700 focus-within:border-primary_700 focus-within:border-2"
: "text-danger_700 border-danger_700"
} flex flex-col text-body_small font-semibold text-primary_700 border border-1 border-neutral_100 p-8 rounded-4
} > <div className="flex items-center mb-4"> <span className="mr-8">{person}</span> Hva er ditt navn? (Vil ikke blir vist) </div> <input name="name" {...register("name", { required: "Skriv hvilket produkt det handler om" })} className="text-body_regular font-medium outline-none text-neutral_300 focus:text-neutral_700" /> </label> </div> <div className="h-18 mb-16"> {errors.name && ( <span className="flex px-8 rounded-4 text-body_small text-danger_700 font-semibold bg-danger_50"> {errors.name.message} </span> )} </div>
Any help would be greatly appreciated! Best regards,
Ragnsan
Beta Was this translation helpful? Give feedback.
All reactions