-
Notifications
You must be signed in to change notification settings - Fork 32
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 the problem on destroy happening to fast #111
Conversation
Could be fixing also #38 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution @bhugot!
I have checked your PR and it looks quite good 👍 Did some minor refactoring. See also one tests related comment.
Looking at your example from #110 I wonder what will happen if component will be shown again (might be the case described in #38). Will the components used inside (so ckeditor
one) be initialized as new instances? I'm wondering if _destroyed
flag state will be correct in such cases 🤔
Could be fixing also #38
As you also mentioned it, would you be willing to add unit test covering this case also (so probably the same thing I described above too)?
About the #38 as we don't even call create editor we should not have this problem |
Be aware that there is still a case where it will be failling if the component is in a ng-content as the ngOnDrestroy is not called https://stackblitz.com/edit/angular-ivy-jvybwy?file=src%2Fapp%2Fapp.component.html |
@ezintz Thank you for checking this PR!
@bhugot can you elaborate more on this one? I don't see any errors in your code sample (nor CKEditor component)? |
this example only show that when you have a as parent of another component then even if not displayed the ngOnInit is call (look in console log 'Child initialized') but the onDestroy is not call. That can lead on error with CKEditor (it's not an issue with ckeditor-angular) just for reference if someone has this issue sometime after this PR is merged |
Thanks for the clarification @bhugot 👍 So it seems this is an issue in Angular itself (btw. do you have any number/reference to this issue, was it reported somewhere)? Do you know any workaround for this issue so we can keep it for future reference? |
An issue on this : angular/angular#18982 |
Rebased onto latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Thank you for contributing @bhugot!
You're welcome |
The problem is visible in #110