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 @@
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();
......