Skip to content
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

Feature idea - passing required attribute to rendered elements #12

Open
samrae7 opened this issue Sep 18, 2017 · 0 comments
Open

Feature idea - passing required attribute to rendered elements #12

samrae7 opened this issue Sep 18, 2017 · 0 comments

Comments

@samrae7
Copy link
Collaborator

samrae7 commented Sep 18, 2017

hey,

Do you think it would be ok to have it so that the input component adds an html attribute (required) to the input that it renders based on if the 'required' rule is in the list of rules for that component instance?

This would be so that if in my project I want different styling for a required input ( ie. an asterix next to the label for that input) I don't have to add a className for required in addition to adding the rule in the form config. The css wouldn't be part of the library but the library would give you the required attribute automatically.

Let me know if you agree with this. I could do a PR.

Could do something similar for other components eg, select ( which is passed required as a prop but doesn't pass it to the html elements it renders as far as I can see)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant