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

Feature 637: Added scrollMode prop #670

Merged
merged 1 commit into from Mar 3, 2020
Merged

Feature 637: Added scrollMode prop #670

merged 1 commit into from Mar 3, 2020

Conversation

mariano-formidable
Copy link
Member

@mariano-formidable mariano-formidable commented Feb 27, 2020

This PR adds the scrollMode prop to nuka. When it's set to page, nuka will set slidesToScroll equal to slidesToShow and page through each slide which can result in blank slides at the end. However, if scrollMode is set to remainder, then nuka will behave at it normally does.

Fixes #637

Type of Change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

Manually tested, and all the CI tests pass.

Screenshots

Scroll mode set to remainder, slidesToShow=2, slidesToScroll=1:
remainder-v2

Scroll mode set to page, slidesToShow=2, nuka ignores the prop `slidesToShow':
page

@mariano-formidable mariano-formidable changed the title [WIP] Issue 637: Added scrollMode prop Issue 637: Added scrollMode prop Feb 28, 2020
@mariano-formidable mariano-formidable changed the title Issue 637: Added scrollMode prop Feature 637: Added scrollMode prop Feb 28, 2020
@sarmeyer
Copy link
Member

I think we just need to define a type for ScrollMode in index.d.ts - otherwise looks good to me

@mariano-formidable
Copy link
Member Author

I think we just need to define a type for ScrollMode in index.d.ts - otherwise looks good to me

Ohhhhhh yeah, I forgot nuka now has internal types. I'll update the type file and let you know when you can re-review.

* Supports 'page' and 'remainder' scroll modes.
* Defaults to 'remainder'.
*/
scrollMode?: CarouselScrollModeProp;
Copy link
Member Author

Choose a reason for hiding this comment

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

Updated the type defs 👍

@sarmeyer sarmeyer merged commit ff5d66e into master Mar 3, 2020
@sarmeyer sarmeyer deleted the feature/scroll-mode branch March 12, 2021 23:05
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.

ScrollMode prop
2 participants