diff --git a/src/app/components/galleria/galleria.ts b/src/app/components/galleria/galleria.ts index 1e1db91efee..a1b65b7c5e3 100755 --- a/src/app/components/galleria/galleria.ts +++ b/src/app/components/galleria/galleria.ts @@ -62,7 +62,7 @@ import { platformBrowser } from '@angular/platform-browser'; (@animation.done)="onAnimationEnd($event)" [value]="value" [activeIndex]="activeIndex" - [numVisible]="numVisible" + [numVisible]="numVisibleLimit || numVisible" (maskHide)="onMaskHide()" (activeItemChange)="onActiveItemChange($event)" [ngStyle]="containerStyle" @@ -71,7 +71,7 @@ import { platformBrowser } from '@angular/platform-browser'; - + `, animations: [ @@ -281,6 +281,8 @@ export class Galleria implements OnChanges, OnDestroy { maskVisible: boolean = false; + numVisibleLimit = 0; + constructor(@Inject(DOCUMENT) private document: Document, @Inject(PLATFORM_ID) public platformId: any, public element: ElementRef, public cd: ChangeDetectorRef, public config: PrimeNGConfig) {} ngAfterContentInit() { @@ -327,7 +329,9 @@ export class Galleria implements OnChanges, OnDestroy { ngOnChanges(simpleChanges: SimpleChanges) { if (simpleChanges.value && simpleChanges.value.currentValue?.length < this.numVisible) { - this.numVisible = simpleChanges.value.currentValue.length; + this.numVisibleLimit = simpleChanges.value.currentValue.length; + } else { + this.numVisibleLimit = 0; } }