ember-animate icon indicating copy to clipboard operation
ember-animate copied to clipboard

isDestroyed is not set properly

Open tatemz opened this issue 10 years ago • 6 comments

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.

tatemz avatar Feb 02 '15 21:02 tatemz

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.

tatemz avatar Feb 10 '15 14:02 tatemz

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.

gigafied avatar Feb 10 '15 19:02 gigafied

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

tatemz avatar Feb 10 '15 19:02 tatemz

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.

gigafied avatar Feb 10 '15 19:02 gigafied

Bummer. :-(

tatemz avatar Feb 10 '15 19:02 tatemz

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.

tatemz avatar Feb 10 '15 20:02 tatemz