ng-image-slider icon indicating copy to clipboard operation
ng-image-slider copied to clipboard

Image in Lightbox not shown when parent component uses ChangeDetectionStrategy.OnPush

Open PhilippSoehnlein opened this issue 3 years ago • 1 comments

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).

PhilippSoehnlein avatar Aug 27 '20 07:08 PhilippSoehnlein

I'm having the same issue. Any progress here? I also think the suggested this.changeDetectorRef.detectChanges() call should fix it.

dkimmich-onventis avatar Oct 17 '22 09:10 dkimmich-onventis