Merge pull request #357 from leebyrd/master
fire the 'input' event after setting input value
Showing
1 changed file
with
8 additions
and
4 deletions
... | @@ -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(); | ... | ... |
-
Please register or sign in to post a comment