Skip to content

'isRequired' prop not working for me in my <Form> 's <TextField /> #4245

Closed Answered by snowystinger
sndp-s asked this question in Q&A
Discussion options

You must be logged in to vote

The reason this is happening is because we use aria-required, not the required attribute. This was done as a result of this issue #2123

The main point of which is, we don't want the native prompt. There may be form elements that are invisible because their UI is presented stylistically in a different way, such as ColorArea, ColorWheel, Slider, etc. So the native prompt would look strange.

And finally, there may be form elements which are not backed by a native input or are backed by several. These would need to be managed at the React State level anyways. Example, DateField, which consists of multiple segments.

If anything is required, you should prevent the form from submitting yourself …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sndp-s
Comment options

Answer selected by sndp-s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants