Bug 604351 - Software keyboard on Android doesn't pop up when focus is in an input field [r=mfinkle]
authorVivien Nicolas <21@vingtetun.org>
Thu, 14 Oct 2010 19:22:15 +0200
changeset 66834 43a96c377053f5cf98a80c4c51879ee082e38a35
parent 66833 cb131a9ce6f1b01846d3a0385e074b20a2709da3
child 66835 53c39785522304d30d8e1564bc984e60549abce0
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)
reviewersmfinkle
bugs604351
Bug 604351 - Software keyboard on Android doesn't pop up when focus is in an input field [r=mfinkle]
mobile/chrome/content/forms.js
--- a/mobile/chrome/content/forms.js
+++ b/mobile/chrome/content/forms.js
@@ -108,18 +108,27 @@ FormAssistant.prototype = {
         return false;
 
       sendAsyncMessage("FormAssist:Hide", { });
       return this._open = false;
     }
 
     // Checking if the element is the current focused one while the form assistant is open
     // allow the user to reposition the caret into an input element
-    if (this._open && aElement == this.currentElement)
+    if (this._open && aElement == this.currentElement) {
+      //hack bug 604351
+      // if the element is the same editable element and the VKB is closed, reopen it
+      let utils = Util.getWindowUtils(content);
+      if (utils.IMEStatus == utils.IME_STATUS_DISABLED && aElement instanceof HTMLInputElement && aElement.mozIsTextField(false)) {
+        aElement.blur();
+        aElement.focus();
+      }
+
       return false;
+    }
 
     // If form assistant is disabled but the element of a type of choice list
     // we still want to show the simple select list
     this._enabled = Services.prefs.getBoolPref("formhelper.enabled");
     if (!this._enabled && !this._isSelectElement(aElement)) {
       sendAsyncMessage("FormAssist:Hide", { });
       return this._open = false;
     }