-
Notifications
You must be signed in to change notification settings - Fork 700
Indicators causing bug in Carousel: "invalid array length" #2045
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
Comments
Hey there @ddavisj, you can fix the above issue by removing the |
Thanks @selemondev, I just tried removing this line and it broke the functionality. The images no longer appear at all. The error seems to act intermittently, it's not appearing - not sure why but will update this page if it reoccurs. |
Hey there @ddavisj, here is an example of one: |
The problem was not solved. Does anyone have another solution? |
I have reproduced this below.
This issues seems to be caused by the pages property in Carousel.vue, and happens when the length of the items prop is less than the number of carousel pages. The number of pages is calculated from the width of the carousel and each item, which can be set multiple ways such as
In my case I was using this carousel to show recently viewed products, however when you first enter the site you may only have one recently viewed product, and so this issue occurred. I have also tried removing
Something like this seems to fix it:
|
Environment
Version
v2.18.4
Reproduction
N/A - website is still in beta, not ready for launch/links
Description
Carousel appears to be working. When included, the indicator buttons do appear and work but also throw an error in the JS console. The arrows also work.
HTML
JS console error
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: