Skip to content

[iOS]CarouselView Position Not Respected When Changing From Hidden to Visible in CV2 - fix #29999

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 3 commits into
base: main
Choose a base branch
from

Conversation

kubaflo
Copy link
Contributor

@kubaflo kubaflo commented Jun 15, 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!

Issues Fixed

Fixes #29309

@Copilot Copilot AI review requested due to automatic review settings June 15, 2025 22:43
@kubaflo kubaflo requested a review from a team as a code owner June 15, 2025 22:43
@kubaflo kubaflo self-assigned this Jun 15, 2025
Copy link
Contributor

@Copilot 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 fixes an issue where the CarouselView's position is not respected when changing from hidden to visible by updating the test case to use CarouselView2 and adding a guard in the iOS controller.

  • Updated CarouselViewUpdatePosition.xaml to use CarouselView2 instead of CarouselView1.
  • Added an early return in CarouselViewController2.cs when the control is not visible in order to prevent resetting the initial position.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Controls/tests/TestCases.HostApp/Issues/CarouselViewUpdatePosition.xaml Updated control tags from CarouselView1 to CarouselView2 for test consistency.
src/Controls/src/Core/Handlers/Items2/iOS/CarouselViewController2.cs Added visibility check in UpdateInitialPosition to improve behavior when control is hidden.
Comments suppressed due to low confidence (1)

src/Controls/tests/TestCases.HostApp/Issues/CarouselViewUpdatePosition.xaml:16

  • [nitpick] Consider updating the TODO comment to reflect the current usage of CarouselView2 to avoid confusion for future maintainers.
              <!-- TODO: Replace CarouselView1 with CarouselView once the issues mentioned in the GitHub issue are resolved. -->

Copy link
Contributor

Hey there @@kubaflo! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Member

@rmarinho rmarinho left a comment

Choose a reason for hiding this comment

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

We have a way to run both tests handlers for CarouselView1 and CarouselView2 ? so using CarouselView instead of CarouselView2 should run the tests against both.

@kubaflo
Copy link
Contributor Author

kubaflo commented Jun 17, 2025

We have a way to run both tests handlers for CarouselView1 and CarouselView2 ? so using CarouselView instead of CarouselView2 should run the tests against both.

Right! Fixed

@PureWeen PureWeen added this to the .NET 9 SR11 milestone Aug 4, 2025
@PureWeen PureWeen moved this from Todo to Ready To Review in MAUI SDK Ongoing Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Ready To Review
Development

Successfully merging this pull request may close these issues.

[iOS] - CarouselView Position Not Respected When Changing From Hidden to Visible in CV2
4 participants