Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 62660be

Browse files
authored
docs(input[number]): note issue with large number and step validation
Closes #16486 Closes #16573
1 parent 773f39c commit 62660be

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/ng/directive/input.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,11 @@ var inputType = {
670670
* error docs for more information and an example of how to convert your model if necessary.
671671
* </div>
672672
*
673-
* ## Issues with HTML5 constraint validation
673+
*
674+
*
675+
* @knownIssue
676+
*
677+
* ### HTML5 constraint validation and `allowInvalid`
674678
*
675679
* In browsers that follow the
676680
* [HTML5 specification](https://html.spec.whatwg.org/multipage/forms.html#number-state-%28type=number%29),
@@ -679,6 +683,17 @@ var inputType = {
679683
* which means the view / model values in `ngModel` and subsequently the scope value
680684
* will also be an empty string.
681685
*
686+
* @knownIssue
687+
*
688+
* ### Large numbers and `step` validation
689+
*
690+
* The `step` validation will not work correctly for very large numbers (e.g. 9999999999) due to
691+
* Javascript's arithmetic limitations. If you need to handle large numbers, purpose-built
692+
* libraries (e.g. https://github.com/MikeMcl/big.js/), can be included into AngularJS by
693+
* {@link guide/forms#modifying-built-in-validators overwriting the validators}
694+
* for `number` and / or `step`, or by {@link guide/forms#custom-validation applying custom validators}
695+
* to an `input[text]` element. The source for `input[number]` type can be used as a starting
696+
* point for both implementations.
682697
*
683698
* @param {string} ngModel Assignable AngularJS expression to data-bind to.
684699
* @param {string=} name Property name of the form under which the control is published.

0 commit comments

Comments
 (0)