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

model isnt't updated upon ESC in IE #7297

Closed
kamilkp opened this issue Apr 29, 2014 · 7 comments
Closed

model isnt't updated upon ESC in IE #7297

kamilkp opened this issue Apr 29, 2014 · 7 comments

Comments

@kamilkp
Copy link
Contributor

kamilkp commented Apr 29, 2014

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.

@Narretz
Copy link
Contributor

Narretz commented Apr 29, 2014

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

@kamilkp
Copy link
Contributor Author

kamilkp commented Apr 30, 2014

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).

@caitp
Copy link
Contributor

caitp commented Apr 30, 2014

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.

@romario333
Copy link

@Splaktar
Copy link
Member

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

@petebacondarwin
Copy link
Member

Thanks @Splaktar - I can't confirm locally but @Narretz or @gkalpak probably could and then we can close this issue.

@Narretz
Copy link
Contributor

Narretz commented Sep 1, 2018

Confirmed that this works in AngularJS 1.7.2. Thanks @Splaktar !

@Narretz Narretz closed this as completed Sep 1, 2018
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

7 participants