Skip to content

Commit bacf383

Browse files
Narretznetman92
authored andcommitted
docs(input[number]): mention incompatibility with allowInvalid
Closes angular#11390
1 parent d9ff322 commit bacf383

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: src/ng/directive/input.js

+10
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,16 @@ var inputType = {
612612
* error docs for more information and an example of how to convert your model if necessary.
613613
* </div>
614614
*
615+
* ## Issues with HTML5 constraint validation
616+
*
617+
* In browsers that follow the
618+
* [HTML5 specification](https://html.spec.whatwg.org/multipage/forms.html#number-state-%28type=number%29),
619+
* `input[number]` does not work as expected with {@link ngModelOptions `ngModelOptions.allowInvalid`}.
620+
* If a non-number is entered in the input, the browser will report the value as an empty string,
621+
* which means the view / model values in `ngModel` and subsequently the scope value
622+
* will also be an empty string.
623+
*
624+
*
615625
* @param {string} ngModel Assignable angular expression to data-bind to.
616626
* @param {string=} name Property name of the form under which the control is published.
617627
* @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.

0 commit comments

Comments
 (0)