ember-animate
ember-animate copied to clipboard
isDestroyed is not set properly
While calling this.destroy()
on an Ember.Component
it looks like the isDestroyed
property remains false
even after the willAnimateOut
, animateOut
, & didAnimateOut
sequence has fired.
Additionally, it seems that the element is not removed from the DOM. Browsing through your destroy()
method override, it seems that a lot of the original functionality of Ember.View.destroy()
is lost despire the _super.call(this);
callback. I'd have to browse and test more to further understand your goals and implementation of overriding.
We need to override destroy()
because by default destroy()
is sync. This means that when a View gets destroyed, it gets removed from the DOM before it can animate out. We have to override destroy()
to circumvent this behavior, there is sadly no cleaner way of doing it.
Are you removing the DOM element after your hasAnimatedOut
callback?
EDIT: Per your comment on #36, maybe I am just hitting walls with Ember.Components
Yeah, I think both issues you are having are strictly isolated to Components. I'm guessing the Component class implements it's own destroy logic that doesn't even call _super.
Bummer. :-(
Close inspection of the Ember.Component
reveals that the destroy
method is inherited from Ember.View
. I'll see if we can turn this into a pull request to support components.