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

feat(ui5-carousel): Allow different number of items per page based on component width #1434

Merged
merged 5 commits into from
Apr 6, 2020

Conversation

vladitasev
Copy link
Contributor

@vladitasev vladitasev commented Apr 6, 2020

ui5-carousel is now size-aware:

  • uses a ResizeHandler
  • itemsPerPage replaced by itemsPerPageS, itemsPerPageM and itemsPerPageL. They all have default value of 1 so a plain ui5-carousel without any properties set will behave as before. The user can now increase the number of items for different screen sizes separately. Since the default value for itemsPerPageS is 1, no special logic is needed for phone any more.
  • cycling renamed to cyclic as this is the correct adjective

BREAKING CHANGE:
The cycling property was renamed to cyclic.
The itemsPerPage property was replaced by 3 new properties: itemsPerPageS, itemsPerPageM and itemsPerPageL. To achieve exactly the same result as before, set itemsPerPageM and itemsPerPageL to whatever the value of itemsPerPage was, but it's recommended to set them independently for best user experience.

@vladitasev vladitasev changed the title poc dynamic size feature(ui5-carousel): Allow different number of items per page based on component width Apr 6, 2020
Copy link
Member

@ilhan007 ilhan007 left a comment

Choose a reason for hiding this comment

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

Approve, side note about the commit message: should be "feat",otherwise not be generated in the release note.

@vladitasev vladitasev changed the title feature(ui5-carousel): Allow different number of items per page based on component width feat(ui5-carousel): Allow different number of items per page based on component width Apr 6, 2020
@vladitasev vladitasev merged commit dec0d4d into master Apr 6, 2020
@vladitasev vladitasev deleted the carousel-dynamic-scaling branch April 6, 2020 11:39
Copy link
Contributor

@fifoosid fifoosid left a comment

Choose a reason for hiding this comment

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

Looks good to me, but I noticed two things:

  • If you have
<ui5-carousel items-per-page-m="3" items-per-page-l="4" selected-index="6">

with 7 items for example, in both M and L sizes the selected index would be 6 altough only 2/3 pages are available.

  • The sample page should be updated due to the braking changes.

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