This happens in Internet Explorer 11. Hitting ESC in an input element clears it but the model isn't updated.
Fiddle: http://jsfiddle.net/e8TDg/
type something in the input and then hit ESC button on keyboard. The input clears, but the model value remains.
reset input on escape is an IE specific behavior. Neither FF29 nor Chrome 34 do this. I don't think angular should handle this in core. Fits best into a module hint hint
Well it breaks the expected behaviour. User clicks in the input, hits ESC because for some reason he is used to do it to clear inputs in his browser, then hits the save button and saves to DB not what he expects. It was the reason of a pretty serious bug report in my application and was hard to track down. I would appreciate to see it fixed (or at least welcome for a PR).
to be honest, the correct place to file a bug report for this one would be to microsoft. This would be way too easy to break other things if merged into angular, in my opinion.
If MS wants to behave that way, then they need to emit an input or change event when they do it. And given that they happily emit input events at completely ridiculous times, such as when a control with a placeholder is clicked, then they should be perfectly happy to do it then too.
I have submitted a bug for this with Microsoft: https://connect.microsoft.com/IE/feedback/details/881670/ie11-esc-key-changes-value-of-input-type-text-but-does-not-fire-input-event
I'm not sure if this was fixed by Microsoft as they are no longer updating IE11. They also shut down Microsoft Connect, so the bug link above no longer works.
It also looks like JSFiddle no longer supports IE11 (it's just a bouncing cloud forever).
But I created a CodePen for this and testing in IE11 seems to demonstrate that the model is now updated when the ESCAPE key clears the input. Verified this with AngularJS 1.7.2.
CC @gkalpak
Thanks @Splaktar - I can't confirm locally but @Narretz or @gkalpak probably could and then we can close this issue.
Confirmed that this works in AngularJS 1.7.2. Thanks @Splaktar !