From e546a72d153f95881f6154ffdf0eedee07131a79 Mon Sep 17 00:00:00 2001 From: Yuan Xulei Date: Wed, 8 May 2013 12:27:59 -0400 Subject: [PATCH] Bug 869303 - Notify keyboard to hide when the app window is closed. r=smaug --- b2g/chrome/content/forms.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/b2g/chrome/content/forms.js b/b2g/chrome/content/forms.js index 1c87c950cc48..151d4bc40758 100644 --- a/b2g/chrome/content/forms.js +++ b/b2g/chrome/content/forms.js @@ -185,6 +185,7 @@ let FormAssistant = { addEventListener("resize", this, true, false); addEventListener("submit", this, true, false); addEventListener("pagehide", this, true, false); + addEventListener("beforeunload", this, true, false); addEventListener("input", this, true, false); addEventListener("keydown", this, true, false); addMessageListener("Forms:Select:Choice", this); @@ -292,7 +293,9 @@ let FormAssistant = { break; case "pagehide": - // We are only interested to the pagehide event from the root document. + case "beforeunload": + // We are only interested to the pagehide and beforeunload events from + // the root document. if (target && target != content.document) { break; }