diff --git a/source/ui/Input.js b/source/ui/Input.js index 749226a13..49529af00 100644 --- a/source/ui/Input.js +++ b/source/ui/Input.js @@ -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 @@ -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(""); },