ngu-carousel: Experiencing a browser crash while using fixed tile width and when the component is collapsed
I am trying to use this component in a collapsible container and when the component is collapsed, it is causing chrome to crash because of this line of code
this.pointIndex = Math.ceil(Nos / this.data.slideItems);
What is happening is that this.data.slideItems has value zero which causes this.pointIndex to have an infinite value and the loop just after this runs forever and causes the crash.
The problem is happening in case of fixed width tile scenarios and only when they are collapsed because in that case the below statement assigns this.data.items to 0 as this.data.carouselWidth is zero because the component is in a collapsed state
this.data.items = Math.trunc( this.data.carouselWidth / this.userData.grid.all
and that causes the below piece of code to assign this.data.slideItems to zero
this.data.slideItems = +(this.userData.slide < this.data.items ? this.userData.slide : this.data.items);
(In my case userData.slide was 1 but this.data.items turned out to be zero)
It was a bit hard to track in my application as I am trying to reuse your component multiple times on a page and expanding \ collapsing based on user choice.
Hoping this makes sense and that the fix is easy and it is available soon…
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15
Hi @puneetg1983 @niteshluharuka
Really sorry for delay fix I have fixed the issue now take a look at this release
@puneetg1983 I will try my best
@sheikalthaf - first of all, I must say this is one of the best carousel’s for Angular that I came across so thanks !!!
Unfortunately due to this bug, we cannot use this component. May be it is too much to ask but can I know if you can fix it soon and release an update ?
Even got it on stackblitz - https://stackblitz.com/edit/angular-x2m3xa?file=app/app.component.html