Skip to content

Conversation

@jsuarezruiz
Copy link
Contributor

@jsuarezruiz jsuarezruiz commented Nov 27, 2024

Description of Change

Added tests to validate the ItemsUpdatingScrollMode property in CarouselView.
image

Issues Fixed

Related with #25991

@jsuarezruiz jsuarezruiz added platform/windows area-controls-collectionview CollectionView, CarouselView, IndicatorView area-testing Unit tests, device tests labels Nov 27, 2024
@jsuarezruiz jsuarezruiz requested a review from a team as a code owner November 27, 2024 14:47
@rmarinho
Copy link
Member

rmarinho commented Dec 4, 2024

/rebase

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.

Test is failing in several platforms

@jsuarezruiz
Copy link
Contributor Author

/rebase

@jsuarezruiz
Copy link
Contributor Author

The default value for the ItemsUpdatingScrollMode property is KeepItemsInView

/// <include file="../../../docs/Microsoft.Maui.Controls/ItemsUpdatingScrollMode.xml" path="Type[@FullName='Microsoft.Maui.Controls.ItemsUpdatingScrollMode']/Docs/*" />

So, by default, the CarouselView should move the scroll to the first item after add a new one. That happens on Windows, after merge c3f42a9

In the added UITest we can validate the behavior with the three enum options:

  • KeepItemsInView keeps the first item in the list displayed when new items are added.
  • KeepScrollOffset ensures that the current scroll position is maintained when new items are added.
  • KeepLastItemInView adjusts the scroll offset to keep the last item in the list displayed when new items are added.

However, as described in the issue, on Android the position is maintained by default. That's wrong. However, more than fix the Windows behavior, seems like it is wrong on other platforms. @Tamilarasan-Paranthaman Could you check the tests results and align/fix the behavior between platforms?

Close in favor of #26608

@github-actions github-actions bot locked and limited conversation to collaborators Mar 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-collectionview CollectionView, CarouselView, IndicatorView area-testing Unit tests, device tests platform/windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants