Skip to content

Instantly share code, notes, and snippets.

@RudyLu
Created July 27, 2012 22:05
Show Gist options
  • Save RudyLu/3190691 to your computer and use it in GitHub Desktop.
Save RudyLu/3190691 to your computer and use it in GitHub Desktop.
form.js patch for <select> on Gaia
diff -r b5c4b792f3f2 b2g/chrome/content/forms.js
--- a/b2g/chrome/content/forms.js Mon Jul 30 17:20:58 2012 +0300
+++ b/b2g/chrome/content/forms.js Mon Jul 30 16:08:55 2012 -0700
@@ -61,6 +61,7 @@
content.setTimeout(function showIMEForSelect() {
sendAsyncMessage("Forms:Input", getJSON(evt.target));
});
+ this.previousTarget = evt.target;
} else if (evt.target instanceof HTMLOptionElement &&
evt.target.parentNode instanceof HTMLSelectElement) {
content.setTimeout(function showIMEForSelect() {
@@ -124,6 +125,8 @@
options.item(i).selected = (json.indexes.indexOf(i) != -1);
}
}
+
+ target.blur();
break;
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment