Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
markrian opened this issue Mar 17, 2025 · 0 comments · May be fixed by #13060
Open

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

markrian opened this issue Mar 17, 2025 · 0 comments · May be fixed by #13060

Comments

@markrian
Copy link

markrian commented Mar 17, 2025

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.

@markrian markrian changed the title Nullish dynamic event names with a modifier create attributes with modifier's name Nullish dynamic event name with a modifier creates attribute with modifier's name Mar 17, 2025
@edison1105 edison1105 added 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. 🔩 p2-edge-case and removed 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. labels Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants