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

IE9 inputs revert when entering empty string or null #16

Open
chrizy opened this issue Feb 26, 2013 · 3 comments
Open

IE9 inputs revert when entering empty string or null #16

chrizy opened this issue Feb 26, 2013 · 3 comments

Comments

@chrizy
Copy link

chrizy commented Feb 26, 2013

Note: this problem does not exist in IE10 or Chrome,

Setting an initial date, then clicking in an input... highlight all.... delete, then tab out. The empty input will revert to the original date.

@andresmoschini
Copy link
Member

Thanks, I thought that I have fixed it, but I will check again. Did you try the last version (1.1.0)?

@chrizy
Copy link
Author

chrizy commented Feb 26, 2013

Using v1.1.0 from NuGet. Thanks. Can also repro using your demo page http://makingsense.github.com/moment-datepicker/

@bot2600
Copy link

bot2600 commented May 22, 2014

I came here looking for the same thing, I ended up putting in an ugly hack, but it works for me so you can try it and see if it works for you (anyone else coming here looking for this).

I replaced
blur: $.proxy(function (e) {
this.hide();
this.triggerChangeDate();
}, this),
with
blur: $.proxy(function (e) {
//HACK I added this as IE 9 wouldnt clear once a value was in there
if (this.element[0].value == "") {
this.moment = null;
}
this.hide();
this.triggerChangeDate();
}, this),

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants