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
ISSUE #296 - Change item to go to when reaching the start of the item list #316
Conversation
…the item list. ALL credit should go to @https://github.com/donotcodeit
@@ -163,7 +163,7 @@ function checkClonesPosition( | |||
nextSlide = childrenArr.length; | |||
nextPosition = -(itemWidth * nextSlide); | |||
} else { | |||
nextSlide = totalItems - slidesToShow * 2; | |||
nextSlide = totalItems / 3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work for only 3 items or for all different cases with different item amounts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's 3 sequences (copies) of items. Please take a look at my explanation in #296
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest to introduce new constant for the sequences count, because I didn't found one while expecting the code. So for now it's just a hardcoded constant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And to answer to your question: yes, it will work for different amount of items. Already tested and used in production build of product that I maintain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And it makes sense that it'll work for all cases. Since the clones insert a copy of the original items before and after them. So the list of items is always a multiple of 3.
totalItems / 3
will always be the first item in the second bloc of clones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@YIZHUANG I'm not putting any pressure ;-)
Just trying to figure out what you deployment cycle looks like.
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job guys!
released at 2.7.0 |
@all-contributors please add @ak-pdeshaies @donotcodeit for code |
I've put up a pull request to add @ak-pdeshaies! 🎉 |
@all-contributors please add @donotcodeit for code |
I've put up a pull request to add @donotcodeit! 🎉 |
ALL credit should go to @donotcodeit mentions:donotcodeit.