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

Merged
merged 7 commits into from
Dec 11, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ private protected override void DetachingFromWindow()
void TearDown(CarouselView carouselView)
{
_oldViews = null;

InitialPositionSet = false;
carouselView.Scrolled -= CarouselViewScrolled;
DeviceDisplay.MainDisplayInfoChanged -= OnDisplayInfoChanged;

Expand Down Expand Up @@ -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.

{
if (position == -1 || ItemsView is not CarouselView carousel)
if (!InitialPositionSet || position == -1 || ItemsView is not CarouselView carousel)
{
return;
}
Expand Down Expand Up @@ -478,6 +478,9 @@ void SetCurrentItem(int carouselPosition)

internal void UpdateFromCurrentItem()
{
if (!InitialPositionSet)
return;

if (ItemsView is not CarouselView carousel)
{
return;
Expand All @@ -497,6 +500,11 @@ internal void UpdateFromCurrentItem()

internal void UpdateFromPosition()
{
if (!InitialPositionSet)
{
return;
}

if (ItemsView is not CarouselView carousel)
{
return;
Expand Down