MDL-68808 forms: autocomplete throwing error in IE11

This commit is contained in:
Jason Platts
2020-10-01 12:08:12 +01:00
parent 3b52d1658e
commit 82a1f6cd33
3 changed files with 12 additions and 5 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+10 -3
View File
@@ -148,9 +148,16 @@ function($, log, str, templates, notification, LoadingIcon) {
M.core_formchangechecker.set_form_changed();
}
// Note, jQuery .change() was not working here. Better to
// use plain JavaScript anyway.
originalSelect[0].dispatchEvent(new Event('change'));
// Note, jQuery .change() was not working here.
var event;
if (typeof Event === 'function') {
event = new Event('change');
} else {
// Support IE.
event = document.createEvent('Event');
event.initEvent('change', true, true);
}
originalSelect[0].dispatchEvent(event);
};
/**