Skip to content

Event handlers in capturing mode won't be removed #4335

@KingMario

Description

@KingMario

Vue.js version

2.1.3

Reproduction Link

http://codepen.io/KingMario/pen/yVzvoR?editors=0011
From the code pen, you can see that the handler is registered again and again and again without being removed.

What is Expected?

The second h function in the ternary statement returns a new DOM tree will remove the click event handler registered in the first h function.

What is actually happening?

The click event handler is not removed.

Bug Fixed?

According to MDN,

Removal of a capturing listener does not affect a non-capturing version of the same listener, and vice versa.

The bug is fixed in 4th commit of this PR, so please review it or tell me to split it into another PR.

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