diff --git a/mobile/chrome/content/forms.js b/mobile/chrome/content/forms.js index 1c6fc14ba9b8..46eb422a9725 100644 --- a/mobile/chrome/content/forms.js +++ b/mobile/chrome/content/forms.js @@ -79,6 +79,7 @@ function FormAssistant() { addEventListener("focus", this, true); addEventListener("pageshow", this, false); addEventListener("pagehide", this, false); + addEventListener("submit", this, false); this._enabled = Services.prefs.getBoolPref("formhelper.enabled"); }; @@ -295,6 +296,11 @@ FormAssistant.prototype = { let currentElement = this.currentElement; switch (aEvent.type) { + case "submit": + // submit is a final action and the form assistant should be closed + this.close(); + break; + case "pagehide": case "pageshow": // When reacting to a page show/hide, if the focus is different this