Skip to content
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

Fixed [iOS] Fix CarouselViewRemoveAt so that it's passing on both CV1 and CV2 sets of handlers #25919

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

Conversation

NirmalKumarYuvaraj
Copy link
Contributor

Issue Details

When using CV1 handlers, removing the first item from the CarouselView during navigation doesn't work as expected. The removed item remains visible in the view until we manually scroll it. This functionality works correctly with CV2 handlers.

Root Cause

When the CarouselView is detached and then reattached to the window, it doesn't undergo the proper initialization process again. This happens because the InitialPositionSet flag remains true from its previous attachment.

Description of Change

Setting the InitialPositionSet flag to false during the detachment process resolves the issue.

Validated the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Issues Fixed

Fixes #25776

Output

Before After
Before.mov
After.mov

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Nov 18, 2024
Copy link
Contributor

Hey there @NirmalKumarYuvaraj! 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 jsuarezruiz added the area-controls-collectionview CollectionView, CarouselView, IndicatorView label Nov 18, 2024
@@ -446,7 +446,7 @@ void ScrollToPosition(int goToPosition, int carouselPosition, bool animate, bool

void SetPosition(int position)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could include an UITest?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jsuarezruiz The test case for this scenario is already present. I have updated it to use the default CarouselView instead of CarouselView2.

@NirmalKumarYuvaraj NirmalKumarYuvaraj marked this pull request as ready for review November 20, 2024 09:35
@NirmalKumarYuvaraj NirmalKumarYuvaraj requested a review from a team as a code owner November 20, 2024 09:35
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[iOS] Fix CarouselViewRemoveAt so that it's passing on both CV1 and CV2 sets of handlers
2 participants