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

required prop for Input doesn't actually set required on the input #709

Open
dzucconi opened this issue Jun 12, 2020 · 4 comments
Open

required prop for Input doesn't actually set required on the input #709

dzucconi opened this issue Jun 12, 2020 · 4 comments

Comments

@dzucconi
Copy link
Member

Passing <Input required /> visually denotes it as being required — I'd expect it to actually pass the prop down to the underlying input, which it doesn't

Just leaving myself this note here.

@iskounen
Copy link
Contributor

Hi. I had the same expectation, but am currently working on a form where this behavior makes sense. The form in question can be saved as a draft or published, and being able to mark its fields as required without setting it on the input has turned out to be useful.

@oxaudo suggested adding a separate visuallyRequired prop for the use case that I described since there may be several uses of the required prop that depend on it not being passed down to the underlying input.

@dzucconi
Copy link
Member Author

@iskounen To me it just sounds like this component is semantically confusing. It's not just an input, it's a field complete with label. To me that's something else entirely. Inputs on their own should be unsurprising and accept the complete range of native props.

@dzucconi
Copy link
Member Author

Of course, I think this is a problem in terms of how to move forward 🤔

@iskounen
Copy link
Contributor

I see where you're coming from, and I agree.

I hadn't considered your point about the label before, but it would be useful to have that be separate like it is in Bootstrap.

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

2 participants