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 looking for a way to show some helper text on an unvalidated field and then swap it out for FieldFeedback error messages when necessary. Is there an easy way to do that?
I thought <FieldFeedback when="valid" might do what I want, but that only seems to display after the form has been validated (which makes sense). I then tried to just apply a <FieldFeedback info/> with my helper text in it, but that also doesn't show up until after a validation (and even then looks just like an error message).
So I'm looking at tracking which fields are unvalidated or validdated-and-valid (either in state or via a bunch of refs) so I can show/hide some typography inside helperText... But that feels extra dirty, so I figured it was worth asking here -- Is there a better way to do what I'm after?
The text was updated successfully, but these errors were encountered:
tkrotoff
changed the title
For material-ui, is there a way to show "everything's OK" helper text for unvalidated fields?
Show something while a field is untouched, when dirty replace by feedbacks
Apr 4, 2019
For the moment, you have to handle this yourself.
Something like:
state={fieldUntouched: true};handleChange(e){this.setState({fieldUntouched: false});}handleReset(){this.setState({fieldUntouched: true});}<FieldFeedbacksfor="field"> // Displayed when field has been validated, i.e dirty
...
</FieldFeedbacks>{fieldUntouched ? <div>Help</div> : null}
If you have any other use case that is not handled by react-form-with-constraints, I would be glad to hear.
Thx.
I hate to be a pest with stupid questions.... ;)
I'm looking for a way to show some helper text on an unvalidated field and then swap it out for
FieldFeedback
error messages when necessary. Is there an easy way to do that?I thought
<FieldFeedback when="valid"
might do what I want, but that only seems to display after the form has been validated (which makes sense). I then tried to just apply a<FieldFeedback info/>
with my helper text in it, but that also doesn't show up until after a validation (and even then looks just like an error message).So I'm looking at tracking which fields are unvalidated or validdated-and-valid (either in state or via a bunch of refs) so I can show/hide some typography inside helperText... But that feels extra dirty, so I figured it was worth asking here -- Is there a better way to do what I'm after?
The text was updated successfully, but these errors were encountered: