You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we hit the submit button, if a field in our form like firstName (for example) is invalid, the page will scroll to that particular field.
In the code it is like this: {...register("firstName")} and it pass to textbox as a props and it destructure something like onChange And probably a Ref and ...
this is normal, but i dont use register, i use setValue and my own onChange, therefore i also want to set my own refrence element, that when my field was invalid, page scroll to where i specify with Ref.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
When we hit the submit button, if a field in our form like firstName (for example) is invalid, the page will scroll to that particular field.
In the code it is like this:
{...register("firstName")}
and it pass to textbox as a props and it destructure something likeonChange
And probably a Ref and ...this is normal, but i dont use
register
, i usesetValue
and my ownonChange
, therefore i also want to set my own refrence element, that when my field was invalid, page scroll to where i specify with Ref.Beta Was this translation helpful? Give feedback.
All reactions