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

[iOS] Fixed the RemainingItemsThresholdReachedCommand not firing issue in CollectionView #26067

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

Conversation

Vignesh-SF3580
Copy link
Contributor

Issue Detail

The RemainingItemsThresholdReachedCommand is not triggered as expected on macOS and iOS platforms.

Root Cause

On macOS and iOS, the index of the items was only being updated based on the currently visible items. During scrolling, the index was not recalculated correctly, which caused the command to fail when the remaining items threshold was reached.

Description of Change

Updated the logic to ensure the index of items is recalculated accurately during scrolling. This change ensures that the RemainingItemsThresholdReachedCommand is triggered correctly when the threshold condition is met on macOS and iOS.

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Issues Fixed

Fixes #25889

Screenshots

Before Issue Fix After Issue Fix
Before.Fix.mov
After.Fix.mov

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

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

@Vignesh-SF3580 Vignesh-SF3580 marked this pull request as ready for review November 22, 2024 15:33
@Vignesh-SF3580 Vignesh-SF3580 requested a review from a team as a code owner November 22, 2024 15:33
@jsuarezruiz jsuarezruiz added platform/iOS 🍎 area-controls-collectionview CollectionView, CarouselView, IndicatorView labels Nov 22, 2024
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).


[Test]
[Category(UITestCategories.CollectionView)]
public void RemainingItemsThresholdReachedCommandFired()
Copy link
Contributor

Choose a reason for hiding this comment

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

The test is failing on iOS:

Assert.That(label.GetText(), Is.EqualTo("Command Fired!"))
Expected string length 14 but was 9. Strings differ at index 0.
Expected: "Command Fired!"
But was:  "Not fired"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated the code based on your feedback. Could you please review it and let me know if there are any further concerns

@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 platform/iOS 🍎
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CollectionView with IsGrouped="True" - RemainingItemsThresholdReachedCommand not Firing
2 participants