Bug 514480: upon first launch on my n810, the softkb won't display when focused on an input field, r=gavin
authorMark Finkle <mfinkle@mozilla.com>
Wed, 30 Sep 2009 15:19:42 -0400
changeset 65619 2aefa25a73fd6e5081eea55b97a32cdb8f090c2f
parent 65618 02af623ec8d46893bbafe8e5436871ce72283c71
child 65620 5bdc95a7b84c8425b12b3a279f7abfc1bd5ad6e6
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs514480
Bug 514480: upon first launch on my n810, the softkb won't display when focused on an input field, r=gavin
mobile/chrome/content/browser-ui.js
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -224,16 +224,22 @@ var BrowserUI = {
     if (aEdit && icons.getAttribute("mode") != "edit") {
       icons.setAttribute("mode", "edit");
       this._edit.defaultValue = this._edit.value;
 
       let urlString = this.getDisplayURI(Browser.selectedBrowser);
       if (urlString == "about:blank")
         urlString = "";
       this._edit.value = urlString;
+
+      // This is a workaround for bug 488420, needed to cycle focus for the
+      // IME state to be set properly. Testing shows we only really need to
+      // do this the first time.
+      this._edit.blur();
+      this._edit.focus();
     }
     else if (!aEdit && Browser.selectedTab.isLoading() && icons.getAttribute("mode") != "loading") {
       icons.setAttribute("mode", "loading");
     }
     else if (!aEdit && icons.getAttribute("mode") != "view") {
       icons.setAttribute("mode", "view");
     }
   },