Skip to content

feat: add support for IE11 - #2

Merged
buschtoens merged 1 commit into
masterfrom
feat/ie11-support
Feb 15, 2019
Merged

buschtoens merged 1 commit into
masterfrom
feat/ie11-support

Conversation

@buschtoens

@buschtoens buschtoens commented Feb 15, 2019 •

Copy link
Copy Markdown
Contributor

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

pzuraq commented Mar 29, 2019

Copy link
Copy Markdown

@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

pzuraq commented Mar 29, 2019

Copy link
Copy Markdown

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