You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. I've encountered a little bug when using ng-image-fullscreen-viewer into a component with changeDetection set to ChangeDetectionStrategy.OnPush. When showing the viewer for the first time, the preloader never hides after 500ms because of change detection. The temporary fix for this was to execute the following code on the showViewer function:
public showLightbox(index: number): void {
this.selectedLightboxImageIndex = index;
this.lightboxVisible = true;
setTimeout(() => {
// Fix for preloader and ChangeDetectionStrategy.OnPush
this._changeDetector.detectChanges();
}, 750);
}
If you could also apply a class with display:none to the preloader, or incorporate ChangeDetectorRef and execute detectChanges or markForCheck would be great.
The text was updated successfully, but these errors were encountered:
Hi. I've encountered a little bug when using ng-image-fullscreen-viewer into a component with changeDetection set to ChangeDetectionStrategy.OnPush. When showing the viewer for the first time, the preloader never hides after 500ms because of change detection. The temporary fix for this was to execute the following code on the showViewer function:
If you could also apply a class with display:none to the preloader, or incorporate ChangeDetectorRef and execute detectChanges or markForCheck would be great.
The text was updated successfully, but these errors were encountered: