-
Notifications
You must be signed in to change notification settings - Fork 27.4k
step attribute doesn't trigger validity classes #10597
Comments
@Mouvedia it is next to impossible to assist you based on the info provided (or rather - lack of info...). Please provide a minimal, runnable reproduce scenario using http://plnkr.co/ or similar as per contribution guidelines |
Ill update with more info. But it's pretty descriptive already. |
Yeh, might be for someone that sits in front of the code that exhibits the issue, but is far from being obvious for people not having exactly the same context as you have. For example, how can we guess what is the AngularJS version you are using? |
Anyway, provide a live reproduce scenario using plunker and you will have a response in no time |
@pkozlowski-opensource Seems no one will touch this for months now that you have put it in the "Purgatory" so Ill just use a custom validator to compensate for this obvious omission. |
@Mouvedia we put things in the purgatory milestone by default where there is no enough info to confirm / reproduce the issue. It happens quite often, unfortunately, that people don't provide adequate info and don't come back to us after we request more info - we need a way of tracking those issues. Now, if you want to speed up this issue resolution you can do one of those (which will be needed to fix the issue anyway):
You are welcomed to do any work-around on your side but if you want to see things improving on the core it would be great if you could send us a PR with a fix if you've investigated the issue already and qualified it as omission. |
I can't imagine how much more strict you must be concerning PRs. So Ill just post the fix that Ill come up with when I am done. |
Pawel, number and range inputs use the step attribute to rewrite inputs to be multiples of a given step value. We don't have handled for this for the number our range types, and when native validators are used, we ignore the step mismatch flags. That is the bug they're talking about |
Floating point math is sure annoying in javascript. I suppose that's why you left it out. |
I don't think it would be problematic to support, actually. It's just that nobody had asked for it |
Apologies for words that don't make sense, blame mobile :< |
If you have already done accurate division by floats then yeah the fallback should be a piece of cake. Just remember that you could have invalid values as well. e.g. |
|
Should work on date month week datetime datetime-local time range number |
input[number] will now set the step error if the input value (ngModel $viewValue) does not fit the step constraint set in the step / ngStep attribute. Fixes angular#10597
input[number] will now set the step error if the input value (ngModel $viewValue) does not fit the step constraint set in the step / ngStep attribute. Fixes angular#10597
input[number] will now set the step error if the input value (ngModel $viewValue) does not fit the step constraint set in the step / ngStep attribute. Fixes #10597
input[number] will now set the step error if the input value (ngModel $viewValue) does not fit the step constraint set in the step / ngStep attribute. Fixes angular#10597 (reverted from commit c0b42f0)
input[number] will now set the step error if the input value (ngModel $viewValue) does not fit the step constraint set in the step / ngStep attribute. Fixes angular#10597
input[number] will now set the step error if the input value (ngModel $viewValue) does not fit the step constraint set in the step / ngStep attribute. Fixes angular#10597
input[number] will now set the step error if the input value (ngModel $viewValue) does not fit the step constraint set in the step / ngStep attribute. Fixes angular#10597
input[number] will now set the step error if the input value (ngModel $viewValue) does not fit the step constraint set in the step / ngStep attribute. Fixes angular#10597
input[number] will now set the step error if the input value (ngModel $viewValue) does not fit the step constraint set in the step / ngStep attribute. Fixes angular#10597
input[number] will now set the step error if the input value (ngModel $viewValue) does not fit the step constraint set in the step / ngStep attribute. Fixes #10597
input[number] will now set the step error if the input value (ngModel $viewValue) does not fit the step constraint set in the step / ngStep attribute. Fixes #10597
input[number] will now set the step error if the input value (ngModel $viewValue) does not fit the step constraint set in the step / ngStep attribute. Fixes #10597
When you are using
step="1"
a float value enablesvalidity.stepMismatch
. This is not reflected by the ng classes on the input.e.g.
steps to reproduce:
validity.stepMismatch
of the input (true)Affected version: 1.3.5
The text was updated successfully, but these errors were encountered: