Reactive forms validators are not represented in DOM (different behavior with the Template-driven forms) #43717
Labels
area: forms
design complexity: major
P4
A relatively minor issue that is not relevant to core functions
Milestone
Which @angular/* package(s) are the source of the bug?
forms
Is this a regression?
No
Description
The maxlength validator (https://angular.io/api/forms/MaxLengthValidator) works fine in Reactive Forms. However when using the maxlength attribute on a input in a Template Driven Form then the input is really restricted to the amount of characters which is specified via the maxlength attribute.
Expected behavior in Template Driven Form:
The input should not be restricted to the amount of characters. The form (or the formControl tied to the input) should just become invalid when the max amount of characters is exceeded.
It looks like the maxlength attribute is somehow conflicting with the Html input maxlength attribute (https://www.w3schools.com/tags/att_input_maxlength.asp)
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/angular-maxlength-validator-conflicts-with-html-maxlength?file=src/app/app.component.html
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in
Anything else?
Actually I don't know if this is a regression.
The text was updated successfully, but these errors were encountered: