Open bparadie opened 7 years ago
These attributes are about the form level validation when submitted. Not the individual input nodes within it. There are cases where you may wish to novalidate
the form (or individual items) yet still use JavaScript to check for validity as the user enters data.
The existing functionality matches what the browsers provide very closely. We shouldn't stray from that too far. Is there any alternative solution that could provide the functionality needed without interfering with what developers already understand of the platform?
@bparadie Thanks for the bug report!
I am not entirely sure if looking at novalidate
/formnovalidate
is the right angle for this. Could you please provide some details on what you're trying to accomplish, so that we have a bit more context in deciding on how to address this?
Bugs
Follow the template below to ensure the quickest and most accurate response to your issue.
What MDC-Web Version are you using?
What browser(s) is this bug affecting?
What OS are you using?
What are the steps to reproduce the bug?
What is the expected behavior?
What is the actual behavior?
Any other information you believe would be useful?
The problem is in https://github.com/material-components/material-components-web/blob/master/packages/mdc-textfield/foundation.js#L112
It should be more along the lines of:
Note that in most cases those
input
elements are used in forms. There are two attributes that the HTML5 spec mentions for disabling form validation:<form novalidate>
<input formnovalidate>
For more details see https://www.html5rocks.com/en/tutorials/forms/constraintvalidation/
It would be great if
mdc-textfield
supportedformnovalidate
andnovalidate
attributes.