Closed rmeshksar closed 4 years ago
hi @rmeshksar, If that solves the issue I would be happy to accept the pr.
I noticed my suggested solution won't work in all cases, specially when there are some ngIf logic inside the child component that can happen dynamically. This is due the fact that in Angular ng-content gets built and initialized even if ngIf is false.
I found another library that works for me, so, I don't need this to get fixed.
Hi, I am using a component library and noticed that scroll is not displayed when using one of those components. In order to simulate the situation I simplified it in this link: https://stackblitz.com/edit/angular-ivy-anoj89
There is a child component called Hello and it uses ngIf and ng-content.
Now when used in the parent component with slimScroll directive, it does not get displayed. In fact when checking the DOM the wrapper does not exists.
As I mentioned it is a simplified version of the third party component that I use and cannot change the internals of that.
One of the way to solve this issue is to add another input to slimScroll directive, we can call it delayed (boolean, default = false). If the delated value is true we can run setup in a setTimeout.
I tried that locally and seems to be working. If you think that is an acceptable approach I can create PR.
Thanks.