Skip to content

Conversation

@duygu-rmdn
Copy link
Member

Carousel now checks for empty content when data changes and hides empty slides.

JIRA:BGSOFUIRODOPI-3548

Carousel now checks for empty content when data changes and hides empty slides.

JIRA:BGSOFUIRODOPI-3548
@ui5-webcomponents-bot
Copy link
Collaborator

ui5-webcomponents-bot commented Oct 16, 2025

🧹 Preview deployment cleaned up: https://pr-12498--ui5-webcomponents.netlify.app

@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview October 16, 2025 14:31 Inactive
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview October 17, 2025 09:28 Inactive
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview October 20, 2025 08:46 Inactive
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview October 20, 2025 09:08 Inactive
@duygu-rmdn duygu-rmdn requested a review from a team October 20, 2025 14:04
Copy link

@Stoev Stoev left a 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?

@duygu-rmdn duygu-rmdn changed the title fix(ui5-carousel): prevent rendering of empty items fix(ui5-carousel): exclude hidden items from rendering and navigation Oct 27, 2025
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview October 27, 2025 12:42 Inactive
Copy link
Contributor

Copilot AI left a 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 _visibleItems getter to filter out items with the hidden attribute
  • 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-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview October 27, 2025 13:18 Inactive
@duygu-rmdn duygu-rmdn dismissed GerganaKremenska’s stale review October 28, 2025 08:02

already got an approve

@duygu-rmdn duygu-rmdn merged commit 8ddfab2 into main Oct 28, 2025
35 of 38 checks passed
@duygu-rmdn duygu-rmdn deleted the carousel_hide_elements branch October 28, 2025 08:02
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview October 28, 2025 08:02 Inactive
plamenivanov91 pushed a commit to plamenivanov91/ui5-webcomponents that referenced this pull request Oct 28, 2025
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.

6 participants