Commit 9cbbe80d 9cbbe80d8302eb128bd940c554b2df2c78f868f2 by Nicolas Perriault

Merge pull request #357 from leebyrd/master

fire the 'input' event after setting input value
2 parents 1e09046e ec7adf09
...@@ -744,10 +744,14 @@ ...@@ -744,10 +744,14 @@
744 out = 'Unsupported field type: ' + nodeName; 744 out = 'Unsupported field type: ' + nodeName;
745 break; 745 break;
746 } 746 }
747 // firing the `change` event 747
748 var changeEvent = document.createEvent("HTMLEvents"); 748 // firing the `change` and `input` events
749 changeEvent.initEvent('change', true, true); 749 ['change', 'input'].forEach(function(name) {
750 field.dispatchEvent(changeEvent); 750 var event = document.createEvent("HTMLEvents");
751 event.initEvent(name, true, true);
752 field.dispatchEvent(event);
753 });
754
751 // blur the field 755 // blur the field
752 try { 756 try {
753 field.blur(); 757 field.blur();
......