ng-image-slider
ng-image-slider copied to clipboard
Image in Lightbox not shown when parent component uses ChangeDetectionStrategy.OnPush
When the parent component uses ChangeDetectionStrategy.OnPush
the loading spinner in the lightbox is shown until a change detection is triggered (e.g. by a mouse move or via code).
Here's a demo: https://stackblitz.com/edit/ng-image-slider-demo-qupet5?file=src/app/slider/slider.component.ts
The reason is probably the strange setTimeout
here: https://github.com/sanjayV/ng-image-slider/blob/master/projects/ng-image-slider/src/lib/slider-lightbox/slider-lightbox.component.ts#L134
(and the issue can hopefully be resolved by just adding a this.cdRef.detectChanges()
right after setting this.isLoading
to false
).
I'm having the same issue. Any progress here?
I also think the suggested this.changeDetectorRef.detectChanges()
call should fix it.