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

Events listeners are not unbound when reusing nodes #4650

Closed
posva opened this issue Jan 4, 2017 · 3 comments
Closed

Events listeners are not unbound when reusing nodes #4650

posva opened this issue Jan 4, 2017 · 3 comments
Assignees
Labels

Comments

@posva
Copy link
Member

posva commented Jan 4, 2017

Vue.js version

2

Reproduction Link

http://jsfiddle.net/posva/hdqz1bc3/

Steps to reproduce

  1. Click the toggle
  2. select a value in the select

What is Expected?

No error in console

What is actually happening?

The select is trying to fire the change from the previous select. Adding a key attribute to one of the selects is a workaround @rorc

@defcc
Copy link
Member

defcc commented Jan 5, 2017

Seems an edge case for update-listener

old.length = cur.length
for (let i = 0; i < old.length; i++) old[i] = cur[i]

cur is a function type here, so it breaks. I'll fix it.

@defcc defcc self-assigned this Jan 5, 2017
@jimczj
Copy link

jimczj commented Jan 9, 2017

@posva I have forked your JSFiddle example ,and I found that if your added @change="foo" to the select2,it can run normally. http://jsfiddle.net/jimczj/hm0onwy9/1/

@posva
Copy link
Member Author

posva commented Jan 9, 2017

@jimczj Yes, that makes the function defined when trying to invoke it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants