-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use the Event constructor in browsers that support it. Fixes #4188. #4191
Conversation
For old IE, it falls back to createEvent + initEvent, the latter of which is deprecated and may be missing from some browsers.
Downgrade is also needed. |
Good catch, thanks! Will amend. |
Sorted, downgrade is now fixed too. As an aside, Drone is acting up, so the build may fail. @crhym3 is on it. |
LGTM, our only other uses of initEvent are internal to tests. So they don't need to be upgraded right away. |
Thanks, @Garbee! |
Use the Event constructor in browsers that support it. Fixes #4188.
@@ -351,9 +358,15 @@ componentHandler = (function() { | |||
upgrades.splice(componentPlace, 1); | |||
component.element_.setAttribute('data-upgraded', upgrades.join(',')); | |||
|
|||
var ev = document.createEvent('Events'); | |||
ev.initEvent('mdl-componentdowngraded', true, true); | |||
component.element_.dispatchEvent(ev); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you removed the dispatchEvent...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I did remove it on the downgrade event! Thanks for the keen eye, @tleunen!
* master: fixing mocha errors fixing eslint related errors and warnings eslint error fixes Remove automatic name/value example. Functionality was removed before publishing. Update button note to reflect disabled classes purpose. Fix downgrade event firing (bug introduced in google#4191) Small tweak to make Closure compiler happy Bump to 1.1.3 Fix grammatical error Fix snackbar position on mobile.
For old IE, it falls back to createEvent + initEvent, the latter of
which is deprecated and may be missing from some browsers.
@surma @Garbee PTAL!