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

addEventListener and removeEventListener doesn't work with EventListenerOptions #737

@vevnin

Description

@vevnin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions