-
Couldn't load subscription status.
- Fork 280
fix(ui5-carousel): exclude hidden items from rendering and navigation #12498
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
Conversation
Carousel now checks for empty content when data changes and hides empty slides. JIRA:BGSOFUIRODOPI-3548
|
🧹 Preview deployment cleaned up: https://pr-12498--ui5-webcomponents.netlify.app |
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.
Would a commit header "fix(ui5-carousel): exclude hidden items from rendering and navigation" convey the change as well?
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.
Pull Request Overview
This PR enhances the Carousel component to properly handle hidden items by excluding them from rendering and navigation. The implementation adds a MutationObserver to track changes to item visibility, filters out hidden items from carousel operations, and ensures navigation indices are updated when items are dynamically hidden or shown.
Key Changes:
- Added MutationObserver to detect when content items are hidden/shown dynamically
- Introduced
_visibleItemsgetter to filter out items with thehiddenattribute - Updated all navigation and rendering logic to use visible items instead of all content items
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/main/src/Carousel.ts | Implements core logic for filtering hidden items, adds MutationObserver for dynamic updates, and refactors navigation to use visible items |
| packages/main/test/pages/Carousel.html | Adds interactive test cases for hidden items functionality with toggle and add operations |
| packages/main/cypress/specs/Carousel.cy.tsx | Adds automated test coverage for hidden items behavior in various scenarios |
…UI5#12498) JIRA:BGSOFUIRODOPI-3548
JIRA:BGSOFUIRODOPI-3548 Related with #12498
Carousel now checks for empty content when data changes and hides empty slides.
JIRA:BGSOFUIRODOPI-3548