Skip to content

Transitioned elements lose v-ref #536

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

Closed
tim-smart opened this issue Nov 3, 2014 · 8 comments
Closed

Transitioned elements lose v-ref #536

tim-smart opened this issue Nov 3, 2014 · 8 comments

Comments

@tim-smart
Copy link

See this codepen: http://codepen.io/anon/pen/ovcpq

@tim-smart tim-smart changed the title Transitioned elements lose v-el Transitioned elements lose v-ref Nov 3, 2014
yyx990803 added a commit that referenced this issue Nov 4, 2014
@yyx990803
Copy link
Member

Thanks for reporting - this is caused by a change to the transition implementation (components being transitioned out are destroyed after the transition finishes)

@tim-smart
Copy link
Author

Interesting. In my app the state changes during the transition, so you can see things changing as the element transitions out.

Is there anyway to disconnect the data bindings before the transition starts?

@yyx990803
Copy link
Member

The latest commit on next should have fixed that.

@tim-smart
Copy link
Author

Much better, thanks!

However the event listeners still seem to be listening (registered through the events object on initiation)

@yyx990803
Copy link
Member

Currently only directives are locked so no DOM updates will happen during the transition - events are expected to work until the component is destroyed. Are these event listeners breaking your logic for some reason?

@tim-smart
Copy link
Author

I am using v-component="{{currentView}}" v-transition for routing, and once a route changes so does the data. Some events get fired when the data changes which leads to some inter-component communication that starts getting messy.

Removing v-transition makes everything work well haha. I'm just going to continue without transitions for now.

@yyx990803
Copy link
Member

I reworked $destroy a bit more, it should now work like before, except destroyed will be called after the transition finishes (also after detached).

Let me know if this causes #488 to happen again...

@tim-smart
Copy link
Author

Awesome, seems to be working great!

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

No branches or pull requests

2 participants