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

ISSUE #296 - Change item to go to when reaching the start of the item list #316

Merged
merged 1 commit into from Feb 16, 2022

Conversation

ak-pdeshaies
Copy link
Contributor

ALL credit should go to @donotcodeit mentions:donotcodeit.

@@ -163,7 +163,7 @@ function checkClonesPosition(
nextSlide = childrenArr.length;
nextPosition = -(itemWidth * nextSlide);
} else {
nextSlide = totalItems - slidesToShow * 2;
nextSlide = totalItems / 3;
Copy link
Owner

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?

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

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.

Copy link

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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

Copy link
Owner

@YIZHUANG YIZHUANG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job guys!

@YIZHUANG YIZHUANG merged commit d804b73 into YIZHUANG:master Feb 16, 2022
@YIZHUANG
Copy link
Owner

released at 2.7.0

@YIZHUANG
Copy link
Owner

@all-contributors please add @ak-pdeshaies @donotcodeit for code

@allcontributors
Copy link
Contributor

@YIZHUANG

I've put up a pull request to add @ak-pdeshaies! 🎉

@YIZHUANG
Copy link
Owner

@all-contributors please add @donotcodeit for code

@allcontributors
Copy link
Contributor

@YIZHUANG

I've put up a pull request to add @donotcodeit! 🎉

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

Successfully merging this pull request may close these issues.

None yet

3 participants