Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Carousel cannot render when value.length === 0 && numVisible !== numScroll #1201

Closed
ythomop opened this issue Apr 21, 2021 · 0 comments · Fixed by #1202
Closed

Carousel cannot render when value.length === 0 && numVisible !== numScroll #1201

ythomop opened this issue Apr 21, 2021 · 0 comments · Fixed by #1202
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@ythomop
Copy link
Contributor

ythomop commented Apr 21, 2021

When a Carousel gets an empty array as value prop and numVisible / numScroll !== 1 , then the computed property totalIndicators becomes negative.
As a result, a RangeError is throwed due to this line.

In my case, an empty array is passed to the Carousel component, while it is in the process of being rendered, because of the array's async loading.

I think that the best solution is to add a v-if="totalIndicators >= 0" to this line.

I will create a PR.

@cagataycivici cagataycivici added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working priority - high labels May 10, 2021
@cagataycivici cagataycivici added this to the 3.4.1 milestone May 10, 2021
mertsincan pushed a commit that referenced this issue May 15, 2021
When totalIndicators is below 0 (when the value prop is an empty array) and numScroll !== numVisible, a RangeError is thrown.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants