Skip to content

Nullish dynamic event name with a modifier creates attribute with modifier's name #13056

Open
@markrian

Description

@markrian

Vue version

3.5.13

Link to minimal reproduction

https://codepen.io/markrian/pen/OPJmmoW

Steps to reproduce

  1. Write a dynamic event binding with a modifier, e.g., @[eventName].once="onEvent".
  2. Set eventName to an empty value, like null, undefined or empty string.
  3. Notice that the modifier name is written as an attribute on the element.

For example:

Image

What is expected?

The modifier name should not become an attribute on the element.

Image

What is actually happening?

The modifier name becomes an attribute on the element, e.g.,

Image

System Info

Any additional comments?

Vue 2.7.16 behaves as expected, i.e., does not create an attribute.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions