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 @@
out = 'Unsupported field type: ' + nodeName;
break;
}
// firing the `change` event
var changeEvent = document.createEvent("HTMLEvents");
changeEvent.initEvent('change', true, true);
field.dispatchEvent(changeEvent);
// firing the `change` and `input` events
['change', 'input'].forEach(function(name) {
var event = document.createEvent("HTMLEvents");
event.initEvent(name, true, true);
field.dispatchEvent(event);
});
// blur the field
try {
field.blur();
......