Skip to content

Can't have bubbling and capturing event listeners of the same event type on a element #1567

@janispritzkau

Description

@janispritzkau

Version

3.0.0-beta.20

Reproduction link

https://jsfiddle.net/janispritzkau/f4wdbm3r/17/

Steps to reproduce

Click on the element and check the console.

What is expected?

Both the regular bubbling and capture event listener should be added to the element and the handler functions should be called when the event is triggered.

What is actually happening?

The bubbling event listener works fine but the capturing event listener throws an error when triggered and the handler for it doesn't get called.


Here is how you would do this in Vue 2 in a render function:

h("div", {
  on: {
    "click": onClick,
    "!click": onClick
  }
})

The Vue 3 template compiler does something like this:

h("div", {
  onClick: [
    event => onClick(event),
    {
      handler: event => onClick(event),
      options: { capture: true }
    }
  ]
})

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