Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

fix(event): should pass boolean to addEventListener if not support passive #1053

Merged
merged 2 commits into from
Jun 18, 2018

Conversation

JiaLiPassion
Copy link
Collaborator

based on the https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener, IE not support pass options as the 3rd parameter.
So if you call addEventListener like this in IE

button.addEventListener('click', handler, {once: true});

user want to pass options as {once: true, capture: false, passive: false}

but because the options will not work in IE11, the finally result will become {capture: true}, which will be the wrong result.

So if browser not support passive, we should pass not pass options as object but as boolean.
just like this.

someElement.addEventListener(eventName, handler, passiveSupported
                               ? options : !!options.capture);

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

1 similar comment
@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@mhevery mhevery merged commit e9536ec into angular:master Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants