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

Remove partialVisibilityGutter when there is not enough children #111

Merged

Conversation

YIZHUANG
Copy link
Owner

@YIZHUANG YIZHUANG commented Dec 5, 2019

No description provided.

@YIZHUANG YIZHUANG force-pushed the fixed/partialVisibilityGutter-when-not-enough-children branch from df4783d to 88eb60f Compare December 5, 2019 00:26
Copy link
Contributor

@abhinavdalal abhinavdalal left a comment

Choose a reason for hiding this comment

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

Wow! This looks so much cleaner now.. I'll test it over the weekend and let you know if it changes anything..

@YIZHUANG
Copy link
Owner Author

Wow! This looks so much cleaner now.. I'll test it over the weekend and let you know if it changes anything..

Thank you.

@abhinavdalal
Copy link
Contributor

@YIZHUANG looks good to me.. i have tested manually.. will try to work to make a pr to add test cases for notEnoughChildren.. resize and children changes should trigger correct functions..

@YIZHUANG YIZHUANG merged commit 77b7163 into master Dec 16, 2019
@YIZHUANG YIZHUANG deleted the fixed/partialVisibilityGutter-when-not-enough-children branch December 16, 2019 09:22
@groomain
Copy link
Contributor

I think we still have the problem after this fix : https://codesandbox.io/s/cool-darkness-368tg?file=/src/App.js

@krunalMahaleCactus
Copy link

@abhinavdalal there is issue here.

function notEnoughChildren(state: CarouselInternalState): boolean {
const { slidesToShow, totalItems } = state;
return totalItems <= slidesToShow; // this should be less then or equal
}

@abhinavdalal
Copy link
Contributor

@krunalMahaleCactus would you be able to create a PR with relevant test cases to make it easier to understand why it should be less than or equal and not less than.. i see the original code (before this PR) also had less than..
I guess the case i am not sure about is if the totalItems == slidesToShow and we want to be able to show the partial visibility in a circular manner if partial visibility is true? I need to think it through more..

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.

5 participants