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

addEventListener and removeEventListener doesn't work with EventListenerOptions #737

Closed
vevnin opened this issue Apr 14, 2017 · 1 comment · Fixed by #738
Closed

addEventListener and removeEventListener doesn't work with EventListenerOptions #737

vevnin opened this issue Apr 14, 2017 · 1 comment · Fixed by #738

Comments

@vevnin
Copy link

vevnin commented Apr 14, 2017

Please see details about EventListenerOptions specification here:
https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md
https://www.chromestatus.com/feature/5745543795965952

The issue is that third parameter of addEventListener and removeEventListener methods is treated as boolean useCapturing parameter. If EventListenerOptions object is used instead then event listener will not be removed with removeEventListener call. This happens because findExistingRegisteredTask task uses reference equality (===) to determine equality of useCapturing parameter. This way it's possible to remove event handler only by passing exactly same object of EventListenerOptions to removeEventListener call.

This behavior seems very counter-intuitive to me. Please add support of EventListenerOptions parameter.

@JiaLiPassion
Copy link
Collaborator

@vevnin , thank you for posting the issue, I will check it.

JiaLiPassion added a commit to JiaLiPassion/zone.js that referenced this issue Apr 15, 2017
JiaLiPassion added a commit to JiaLiPassion/zone.js that referenced this issue Apr 15, 2017
JiaLiPassion added a commit to JiaLiPassion/zone.js that referenced this issue Apr 16, 2017
JiaLiPassion added a commit to JiaLiPassion/zone.js that referenced this issue Apr 16, 2017
JiaLiPassion added a commit to JiaLiPassion/zone.js that referenced this issue Apr 16, 2017
JiaLiPassion added a commit to JiaLiPassion/zone.js that referenced this issue Apr 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants