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

slide is only 1 #7

Open
byungjuJin opened this issue Nov 18, 2024 · 3 comments
Open

slide is only 1 #7

byungjuJin opened this issue Nov 18, 2024 · 3 comments

Comments

@byungjuJin
Copy link

number of slide is only 1, (as dynamic import, it sometimes only 1)
error occured at below code.

slideToScrollNotGreaterThanTotalSlides() { if (this.carouselSlides && this.slideToScroll > this.carouselSlides.length) throw new Error("slideToScroll value is greater than the total amount of slide. This can cause invisible cards in infinite mode. Please lower the slideToScroll value.") }

@GreenFlag31
Copy link
Owner

Hi.

I think that the problem lies in the part of your sentence "dynamic import".
I would like to understand what you clearly mean with "dynamic import". So you dynamically add / remove slides at runtime ?

@byungjuJin
Copy link
Author

byungjuJin commented Nov 20, 2024

nevermind about "dynamic import".
when slide item is only 1 (length is 1), i shows error.

@GreenFlag31
Copy link
Owner

The issue is quite weird because on the demo site I have also a slideToShow set to 1 without issues.
What's the value of slideToScroll in your configuration ? If you try to scroll more items than the number of items you have (only 1 in your case), this is normal that this error is triggered. So, if your value of slideToScroll is greater than one, the error is normal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants