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

mergeProps does not merge correctly event listeners #5296

Closed
sqal opened this issue Jan 20, 2022 · 0 comments · Fixed by #5299
Closed

mergeProps does not merge correctly event listeners #5296

sqal opened this issue Jan 20, 2022 · 0 comments · Fixed by #5299
Assignees
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. 🐞 bug Something isn't working

Comments

@sqal
Copy link
Contributor

sqal commented Jan 20, 2022

Version

3.2.27

Reproduction link

sfc.vuejs.org

Steps to reproduce

  • Open the console to see what's going on
  • Type anything into the input field

What is expected?

Event listeners to be merged correctly

What is actually happening?

Vue throws TypeError: fn is not a function. This happens because, when we try to merge two objects with the same event listeners but one of the objects contains an event with an undefined value, then the result will be an array with an undefined value.

const result = mergeProps({ onKeydown() {} }, { onKeydown: undefined })

// result ---> { onKeydown: [fn, undefined] }
@LinusBorg LinusBorg added 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. 🐞 bug Something isn't working labels Jan 20, 2022
@LinusBorg LinusBorg self-assigned this Jan 20, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Oct 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. 🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants