Skip to content
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

feat: add support for IE11 #2

Merged
merged 1 commit into from
Feb 15, 2019
Merged

feat: add support for IE11 #2

merged 1 commit into from
Feb 15, 2019

Conversation

buschtoens
Copy link
Collaborator

@buschtoens buschtoens commented Feb 15, 2019

Internet Explorer 11 does not fully support addEventListener. The last argument, eventOptions, is ignored and sometimes throws a weird script error.
This also means that { once: true } did not work in IE11.

This PR polyfills support for { once: true } in IE11 and discards any other eventOptions to prevent script errors.

@buschtoens buschtoens merged commit 6295e71 into master Feb 15, 2019
@delete-merged-branch delete-merged-branch bot deleted the feat/ie11-support branch February 15, 2019 14:11
@pzuraq
Copy link

pzuraq commented Mar 29, 2019

@buschtoens it looks like IE11 supports useCapture as the third argument, so we can also support the capture=true API for it. For passive, in development we could replace the e.preventDefault method with one that throws an assertion before passing the event to its handler, that way users can't call it accidentally. I think this would be ideal, since it would mean that behavior is the same for all options between the browser versions.

@pzuraq
Copy link

pzuraq commented Mar 29, 2019

Also great work here, thanks for nailing this down 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants