[V2] `required` attribute should be passed down to native input element
See original GitHub issueFeature request
Bring back the ability to pass the required
attribute down to the native input
element.
In V1.x users of react-select could rely on the required
attribute being passed down to the native input element. This allowed for using native validation for required select fields when used in a form
element. In V2 that has been removed and now forms that use required select fields can submit without being properly validated by the browser (at least to cover the required validation use case). This is an important feature that our team relied on until we can build out more robust validation.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:23
- Comments:8 (2 by maintainers)
Top Results From Across the Web
<input>: The Input (Form Input) element - HTML
Global attribute valid for all elements, including all the input types, it defines a unique identifier (ID) which must be unique in the...
Read more >What is the best way to set the required attribute based on a ...
required is a weird one in HTML. It doesn't need to be set to a boolean value, if it is passed to an...
Read more >Required attribute requirements - TPGi
Introduced in HTML5, the required attribute conveys that a particular form control or grouping of controls must have a valid value on form...
Read more >required - CSS-Tricks
Simply having required on an element lets the browser know this attribute exists and the corresponding input is in fact a required field....
Read more >How to Pass Values Inside Attributes in React | Pluralsight
An attribute with a custom value is required when you want to alter the behavior of an element; hence, in React, you can...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@buesing I think that you’re referring to the v1 documentation. The
required
property was specifically removed in v2 as stated in the prop update guide. I would love to see support forrequired
to be added again. I’d also appreciate hearing the reasoning behind removing it in the first place.would really appreciated support for the
required
attribute!