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

Fix for https://github.com/cibernox/ember-basic-dropdown/issues/615 #623

Closed
wants to merge 2 commits into from

Conversation

ducharmemp
Copy link

@ducharmemp ducharmemp commented Jun 19, 2021

Fixes #615 🤞

I noticed that as of 1819c01#diff-73297f8c71645544a2a6826e5c3146aff7cb2333d9c17fe968258e5f14dc4a79R164 the animationClass was set to transitionedInClass when animating out. I set this back to the original value, and also reordered the calls to preemptively set the state on transitioning out, regardless if the parent element exists. I think this is correct because no matter what the reason (barring animation disabled), on a transition out we want to be able to render with the correct value when the drop down enters the dom again.

@ducharmemp
Copy link
Author

Note that on the preview site, animation out is still semi-broken. Not sure exactly why but I have a hunch that will-destroy is getting called in the template after the parent node has been removed from the DOM, so we're exiting the function early. Local testing confirms this is the case but I'm not sure how or why considering the docs say it'll be called before all that happens.

https://github.com/emberjs/ember-render-modifiers/blob/master/addon/modifiers/will-destroy.js#L4-L5

parentElement = parentElement.parentElement
}
this.animationClass = this.transitioningInClass;
let parentElement = this.destinationElement;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is the right fix, but what I was seeing is that the parentElement was always null on will-destroy calls. However, since we want to animate at the destination location I think this is right? Not sure 🤷‍♂️

@emilkarl
Copy link

emilkarl commented Jul 7, 2021

Seems like this fix isn’t working if you are using renderInPlace but not sure?

@ducharmemp
Copy link
Author

Seems like this fix isn’t working if you are using renderInPlace but not sure?

You might be right, I can't remember if I tested with render in place. I'll give it a look this evening

@dardalan
Copy link
Contributor

Hey @ducharmemp! Any updates on this issue?

@dardalan
Copy link
Contributor

dardalan commented Aug 11, 2021

@ducharmemp @emilkarl imho, it should be just enough to revert this, am i right?
1819c01#diff-73297f8c71645544a2a6826e5c3146aff7cb2333d9c17fe968258e5f14dc4a79R164

this.animationClass = this.transitionedInClass;
change to 
this.animationClass = this.transitioningInClass;

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

Successfully merging this pull request may close these issues.

Transition animation doesn't reset after closing/reopening
3 participants