Skip to content

Cannot listen for mixed case native event #2460

@pgbross

Description

@pgbross

Version

3.0.2

Reproduction link

https://codesandbox.io/s/elated-jepsen-822mv?file=/src/main.js

Steps to reproduce

Create a customEvent that dispatches a mixed case native event.
Vue component cannot listen for mixed case event.

<div @MDCTab:interacted="onInteracted" @foo="onInteracted"><foo></foo></div>
// foo emits a custom event with mixed case, onInteracted never invoked

What is expected?

The docs say there is no need to use camelCase or PascalCase but need to listen to third party custom event in mixed case.

What is actually happening?

Component's event listener is never called for mixed case native events.

Native event listener, event type is case-sensitive https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener

type
A case-sensitive string representing the event type to listen for.

Discovered in the process of updating my vue-material-adapter library to vue-next (it wraps material-components-web which emits mixed case native events)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions