question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[V2] `required` attribute should be passed down to native input element

See original GitHub issue

Feature 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:closed
  • Created 5 years ago
  • Reactions:23
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

10reactions
graywithanAcommented, Jul 20, 2018

@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 for required to be added again. I’d also appreciate hearing the reasoning behind removing it in the first place.

4reactions
rovolutioncommented, Oct 23, 2019

would really appreciated support for the required attribute!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found