This repository has been archived by the owner on Apr 13, 2022. It is now read-only.
ngChange handler called, on submit, for blank type="number" fields, when they haven't changed #17181
Open
1 of 4 tasks
I suppose this doesn't meet the LTS definition of a critical bug.
But I am going to file it here in case it is - at the very least - helpful to other people.
I spent a lot of time tracking down this issue. It's confusing and non-obvious why this would happen.
I'm submitting a ...
Current behavior:
If you initialise, or clear a
<input type="number">
field to blank (ie""
). It'sng-change
handler will always be called on submit. Even if it has not been changed.Expected / new behavior:
Change handler does not get called.
Minimal reproduction of the problem with instructions:
An example
see: http://jsfiddle.net/6qxrygzm/1/
Click the submit button in the demo. The console will log the message "changed" even though the field is untouched from its initialised value.
AngularJS version: 1.8.2
Browser: all | Chrome 98.0.4758.102 | Firefox 97.0.1 (64-bit)
Anything else:
The text was updated successfully, but these errors were encountered: