Commit 2df3bb65 2df3bb65aab22741dd04e46f760351c5eb3d98ea by Nicolas Perriault

Merge pull request #357 from leebyrd/master

fire the 'input' event after setting input value
1 parent 55cdb0bc
...@@ -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();
......