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

Fix events not firing for Scrolled and RemainingItemsThresholdReached #15658

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,19 @@ protected override ListViewBase CreatePlatformView()
protected override void ConnectHandler(ListViewBase platformView)
{
base.ConnectHandler(platformView);
FindScrollViewer(platformView);
Copy link
Member Author

Choose a reason for hiding this comment

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

This was all that was needed -- FindScrollViewer I think was accidentally removed

VirtualView.ScrollToRequested += ScrollToRequested;
}

protected override void DisconnectHandler(ListViewBase platformView)
{
VirtualView.ScrollToRequested -= ScrollToRequested;

if (_scrollViewer != null)
{
_scrollViewer.ViewChanged -= ScrollViewChanged;
}

base.DisconnectHandler(platformView);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void ValidateItemContainerStyle(CollectionView collectionView)
Assert.Equal(0d, minHeight);
}

[Fact(Skip = "FIX FOR .NET8")]
[Fact(DisplayName = "CollectionView SendRemainingItemsThresholdReached")]
public async Task ValidateSendRemainingItemsThresholdReached()
{
SetupBuilder();
Expand All @@ -120,6 +120,11 @@ public async Task ValidateSendRemainingItemsThresholdReached()
collectionView
};

bool didGetScrollEvent = false;
collectionView.Scrolled += (s, e) =>
{
didGetScrollEvent = true;
};
collectionView.RemainingItemsThreshold = 1;
collectionView.RemainingItemsThresholdReached += (s, e) =>
{
Expand All @@ -135,6 +140,7 @@ await CreateHandlerAndAddToWindow<LayoutHandler>(layout, async (handler) =>
collectionView.ScrollTo(19, -1, position: ScrollToPosition.End, false);
await Task.Delay(200);
Assert.True(data.Count == 30);
Assert.True(didGetScrollEvent);
});
}
}
Expand Down