We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 00bfde3 + 47ec98a commit 44a9fa0Copy full SHA for 44a9fa0
addon/mixins/component-child.js
@@ -14,11 +14,16 @@ export default Ember.Mixin.create({
14
let parent = this.nearestOfType(ComponentParentMixin);
15
if (parent) {
16
parent.registerChild(this);
17
+ this.set('_parent', parent);
18
}
19
}),
20
21
+ // stores the parent in didInsertElement hook as a work-a-round for
22
+ // https://github.com/emberjs/ember.js/issues/12080
23
+ _parent: null,
24
+
25
_willDestroyElement: Ember.on('willDestroyElement', function() {
- let parent = this.nearestOfType(ComponentParentMixin);
26
+ let parent = this.nearestOfType(ComponentParentMixin) || this.get('_parent');
27
28
parent.removeChild(this);
29
0 commit comments