Skip to content

[iOS] Fixed the Items are not displaying in CarouselView 2 #29397

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Ahamed-Ali
Copy link
Contributor

@Ahamed-Ali Ahamed-Ali commented May 8, 2025

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Root Cause of the issue

  • Returning a new size directly in the GetDesiredSize method of ItemsViewHandler2.iOS results in a native height of zero, causing the item to be invisible in CarouselView2. (Issue 7678)

  • An exception is caused when attempting to scroll to an index that is out of bounds (i.e., not present in the section), which leads to the issue. (Issue 7678_1)

Description of Change

  • Override the GetDesiredSize method in CarouselViewHandler2.iOS and call GetDesiredSizeFromHandler, which correctly handles and returns the proper native size.

  • Added a check to validate the index before attempting to scroll. This prevents exceptions caused by trying to scroll to an out-of-bounds item in the carousel view.

Fix Reference

Regressed PR

Issues Fixed

Fixes #29310

Test Case

  • Reenabled the test case : Issue7678

  • Reenabled the test case : Issue7678_1

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Screenshot

Before Issue Fix After Issue Fix
CarouselView2Issue.mov
CarouselView2Fix.mov

@dotnet-policy-service dotnet-policy-service bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels May 8, 2025
@jsuarezruiz jsuarezruiz added platform/ios area-controls-collectionview CollectionView, CarouselView, IndicatorView labels May 8, 2025
@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

// TODO: Replace CarouselView1 with CarouselView once the issues are resolved.
var carouselView = new CarouselView1

var carouselView = new CarouselView
Copy link
Contributor

Choose a reason for hiding this comment

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

Could be nice to update some of the related Issue7678 tests to verify some snapshots.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Random colors are used for the border background inside the CarouselView template in the Issue7678 test, so I used a validation test instead of relying on screenshots. @jsuarezruiz

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Ahamed-Ali Ahamed-Ali marked this pull request as ready for review May 9, 2025 11:09
@Ahamed-Ali Ahamed-Ali requested a review from a team as a code owner May 9, 2025 11:09
@Ahamed-Ali Ahamed-Ali requested review from mattleibow and rmarinho May 9, 2025 11:09
@rmarinho
Copy link
Member

/azp run MAUI-public

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen added this to the .NET 9 SR9 milestone Jun 9, 2025
@PureWeen PureWeen moved this from Todo to Ready To Review in MAUI SDK Ongoing Jun 9, 2025
@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@PureWeen PureWeen modified the milestones: .NET 9 SR9, .NET 9 SR10 Jul 3, 2025
@PureWeen PureWeen modified the milestones: .NET 9 SR10, .NET 9 SR11 Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/ios
Projects
Status: Ready To Review
Development

Successfully merging this pull request may close these issues.

[iOS] - CarouselView Items Not Displaying in CV2
4 participants