-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Component State #137
Comments
The form definition has to be a data structure, and it's not possible to put in functions because |
@yogthos Thanks for the reply. How might you recommend we approach something like this? Basically the scenario is we want to conditionally apply a CSS class to inputs based on if they are errored out or not. |
Unfortunately, that's a bit of an omission at the moment. The only field that allows setting class on validation is [:span {:field :container :valid? #(when (empty? (:first-name %)) "error")}
[:input {:field :text :id :first-name}]] I'll take a look at extending this for all field types. |
@yogthos Thanks! I think this will work as a stop gap. |
I'll keep this open actually, since it does look like something that would be good to add. |
@yogthos Maybe if I find the time, I can try and make a PR soon. |
Hi. I wanted to try this library with material-ui. Material-ui has component TextField, which can be used instead of Based on the docs, it doesn't seems to be currently possible. Maybe additional prop could be added into reagent-forms ( |
Yeah, I think having a general function that can modify the attributes would be very useful. |
Hey there! I'm trying to track the state change of an input to apply various CSS classes to it based on valid/invalid state.
For some reason it doesn't seem like the input is being re-rendered after I update component state on blur when I'm using
()
to implement the inputs. Strangely enough, I can see the event firing via console log when I render the input as[]
but the actual state updating still does not happen.Here's a snippet, ignore some of the random stuff in there. The key piece here is the
swap!
on-blur:The text was updated successfully, but these errors were encountered: