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
I'm using React Router's action data to return validation errors from the server. I'm passing those validation errors to my TextInput component (based on react-aria-components) like this:
The problem is: once I set the isInvalid prop, due to how native html5 validation behaves, the form can't be submitted anymore.
steps:
at least 5 characters are required for the title
I add 3 chars, press enter, server validation kicks in and returns the error object with an error message for the title
I type 3 more chars, press enter
Nothing happens because the form still considers the input invalid (since I'm still setting isInvalid=true
I know this is not an issue with RR or RAC per-se, but it feels like a pretty common scenario and I wonder if you have any suggestions on how to fix this?
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
-
I'm using React Router's action data to return validation errors from the server. I'm passing those validation errors to my TextInput component (based on react-aria-components) like this:
The problem is: once I set the isInvalid prop, due to how native html5 validation behaves, the form can't be submitted anymore.
steps:
isInvalid=true
I know this is not an issue with RR or RAC per-se, but it feels like a pretty common scenario and I wonder if you have any suggestions on how to fix this?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions