Skip to content

Commit

Permalink
ENYO-1959: Force Input onchange event for WP8
Browse files Browse the repository at this point in the history
Enyo-DCO-1.1-Signed-off-by: Jeremy Thomas <jeremy.thomas@palm.com>
  • Loading branch information
Jeremy Thomas committed Feb 14, 2013
1 parent 731a079 commit 4dfe5cd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions source/ui/Input.js
Expand Up @@ -54,6 +54,10 @@ enyo.kind({
if (enyo.platform.ie) {
this.handlers.onkeyup = "iekeyup";
}
// adding onkeydown handler for WP8, as there is no onkeyup event for the enter key
if (enyo.platform.ie && window.location.protocol === "x-wmapp0:") {
this.handlers.onkeydown = "iekeydown";
}
this.inherited(arguments);
this.placeholderChanged();
// prevent overriding a custom attribute with null
Expand Down Expand Up @@ -101,6 +105,14 @@ enyo.kind({
this.bubble("oninput", inEvent);
}
},
iekeydown: function(inSender, inEvent) {
var ie = enyo.platform.ie, kc = inEvent.keyCode;
// input event fails to fire on enter key for Windows Phone 8
// this event only happens once, as the keyboard becomes hidden when the enter key is pressed
if (ie == 10 && kc == 13) {
this.bubble("onchange", inEvent);
}
},
clear: function() {
this.setValue("");
},
Expand Down

0 comments on commit 4dfe5cd

Please sign in to comment.