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

input [number] inconsistent behavior between Chrome and FF #1366

Closed
motieliav opened this issue Sep 14, 2012 · 4 comments
Closed

input [number] inconsistent behavior between Chrome and FF #1366

motieliav opened this issue Sep 14, 2012 · 4 comments

Comments

@motieliav
Copy link

Problem with the demo sample in the API guide http://docs.angularjs.org/api/ng.directive:input.number

The demo doesn't work as expected:

Chrome - typing a floating number (e.g. "4.3") returns error (field border turns red)
FF - "4.3" works fine (no error) but "max" is ignored...

Same behavior when I copied to my test application locally.

@vorburger
Copy link

see issue #2144 (possibly close this as a duplicate?)

@caitp
Copy link
Contributor

caitp commented Oct 17, 2013

This is an issue with the browser's constraint validation. The red box (which is not coming from any CSS class or anything) is the browser's focus colour when ValidityState is not valid.

It gets a 'stepMismatch' error, because I guess decimal numbers aren't valid in numeric ranges for a browser, or something.

I won't admit to understanding the logic that they're following, but there isn't much we can do about it as far as I know. IIRC ValidityState is all readonly from script contexts, but I'd have to double check.

At any rate, it's sort of a different thing than #2144, in that regard, even though they are both issues with browser constraint validation. I don't know if it's possible to come up with a work around for this one, short of disabling browser validation, for cases where stepMismatch should be ignored, so it may in fact be a browser/spec bug that needs to be addressed.

@sirkitree
Copy link

If we can't actually fix it, should we come up with a different example, one that does not suffer from this constraint validation? I'm not sure that's possible considering the subject matter, and if it's not, perhaps we can at least link to this issue or put some sort of note near the example in a highlighted manner.

@jeffbcross jeffbcross self-assigned this Feb 6, 2014
@jeffbcross
Copy link
Contributor

Closing as dupe to #2144, which has more recent activity. PR is in progress by @caitp

@jeffbcross jeffbcross removed their assignment Feb 6, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants