You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Example cross-browser implementation for dispatching events
Here is an example of an implementation I've written to help trigger events in a cross-browser way - by combining ideas I've seen across the Internet.
However, it's not been tested thoroughly or anything so please take it with a pinch of salt, but it should hopefully demonstrate how complex this problem really is without a clever way to detect features:
I feel like as a developer community we can come up with some clever ways to detect these various browser APIs used for triggering events and add them into Modernizr.
The text was updated successfully, but these errors were encountered:
There are many ways to trigger events, and depending on what the browser actually supports, this can become a complex area.
I'm very surprised Modernizr does not have any feature detection for any event dispatching methods whatsoever, except CustomEvent.
In general, the following are all valid ways to dispatch events:
CustomEvent & dispatchEvent - Limited browsers (https://caniuse.com/#feat=custom-elementsv1)
Event & dispatchEvent - Modern browsers (not sure which ones)
createEvent, initEvent & dispatchEvent - >= IE9 & modern browsers (not sure which ones)
createEventObject & fireEvent - <= IE8
Example cross-browser implementation for dispatching events
Here is an example of an implementation I've written to help trigger events in a cross-browser way - by combining ideas I've seen across the Internet.
However, it's not been tested thoroughly or anything so please take it with a pinch of salt, but it should hopefully demonstrate how complex this problem really is without a clever way to detect features:
I feel like as a developer community we can come up with some clever ways to detect these various browser APIs used for triggering events and add them into Modernizr.
The text was updated successfully, but these errors were encountered: