-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[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
base: main
Are you sure you want to change the base?
Conversation
/azp run MAUI-UITests-public |
// TODO: Replace CarouselView1 with CarouselView once the issues are resolved. | ||
var carouselView = new CarouselView1 | ||
|
||
var carouselView = new CarouselView |
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.
Could be nice to update some of the related Issue7678 tests to verify some snapshots.
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.
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
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run MAUI-public |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run MAUI-UITests-public |
Azure Pipelines successfully started running 1 pipeline(s). |
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 ofItemsViewHandler2.iOS
results in a native height ofzero
, 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 inCarouselViewHandler2.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
Screenshot
CarouselView2Issue.mov
CarouselView2Fix.mov