Bug 793553 - [b2g] oninput is not fired when the content of an input field is changed. r=mounir
authorVivien Nicolas <21@vingtetun.org>
Wed, 26 Sep 2012 13:08:50 +0200
changeset 108128 bf4f7407c78da2d02f9f0fbb75c979dd765b40d2
parent 108127 be28055643f51b1370c67b8856e9e8a6d6df8e89
child 108129 97e49e7a33266a0680e5af59289264a07e4321f8
push id23539
push userryanvm@gmail.com
push dateWed, 26 Sep 2012 22:55:55 +0000
treeherderautoland@ec079fd92224 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmounir
bugs793553
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 793553 - [b2g] oninput is not fired when the content of an input field is changed. r=mounir
b2g/chrome/content/forms.js
--- a/b2g/chrome/content/forms.js
+++ b/b2g/chrome/content/forms.js
@@ -107,19 +107,24 @@ let FormAssistant = {
   receiveMessage: function fa_receiveMessage(msg) {
     let target = this.previousTarget;
     if (!target) {
       return;
     }
 
     let json = msg.json;
     switch (msg.name) {
-      case "Forms:Input:Value":
+      case "Forms:Input:Value": {
         target.value = json.value;
+
+        let event = content.document.createEvent('HTMLEvents');
+        event.initEvent('input', true, false);
+        target.dispatchEvent(event);
         break;
+      }
 
       case "Forms:Select:Choice":
         let options = target.options;
         let valueChanged = false;
         if ("index" in json) {
           if (options.selectedIndex != json.index) {
             options.selectedIndex = json.index;
             valueChanged = true;