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
Hi everyone,
Lately I've found out that inside the register() function you can find a disabled prop and tap into that in the form :)
I think it'd have much more value if react-hook-form had a method that could set the input to be disabled.
For example: Like having setValue("vitals.pulse") you could have setDisabled("vitals.pulse").
To disable inputs now, in complicated forms, you need to go a long way and do stuff like creating arrays that store the disabled values, for instance:
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
-
Hi everyone,
Lately I've found out that inside the
register()
function you can find adisabled
prop and tap into that in the form :)I think it'd have much more value if
react-hook-form
had a method that could set the input to be disabled.For example: Like having
setValue("vitals.pulse")
you could havesetDisabled("vitals.pulse")
.To disable inputs now, in complicated forms, you need to go a long way and do stuff like creating arrays that store the disabled values, for instance:
and then each input needs to inquire whether or not its name is included in the array.
What are your thoughts regarding this requested feature? Do you think I should open an issue?
Thank you for taking the time to read this ✨🎉
Beta Was this translation helpful? Give feedback.
All reactions