diff --git a/b2g/chrome/content/forms.js b/b2g/chrome/content/forms.js index 151d4bc4075..e0193187ca3 100644 --- a/b2g/chrome/content/forms.js +++ b/b2g/chrome/content/forms.js @@ -188,6 +188,7 @@ let FormAssistant = { addEventListener("beforeunload", this, true, false); addEventListener("input", this, true, false); addEventListener("keydown", this, true, false); + addEventListener("keyup", this, true, false); addMessageListener("Forms:Select:Choice", this); addMessageListener("Forms:Input:Value", this); addMessageListener("Forms:Select:Blur", this); @@ -261,6 +262,7 @@ let FormAssistant = { // current input field has changed. EditAction: function fa_editAction() { if (this._editing) { + this._editing = false; return; } this.sendKeyboardState(this.focusedElement); @@ -359,12 +361,15 @@ let FormAssistant = { this._editing = true; // We use 'setTimeout' to wait until the input element accomplishes the - // change in selection range or text content. + // change in selection range. content.setTimeout(function() { this.updateSelection(); - this._editing = false; }.bind(this), 0); break; + + case "keyup": + this._editing = false; + break; } },