-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 the ListView scroll position center and end without animation #27001
base: main
Are you sure you want to change the base?
Conversation
Hey there @Shalini-Ashokan! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
@dotnet-policy-service agree company="Syncfusion, Inc." |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue26945.cs:18
- The test method name
Issue26945_SelectItemPositionStart
is inconsistent with the other test method names. It should be renamed toIssue26945Test_SelectItemPositionStart
.
public void Issue26945_SelectItemPositionStart()
src/Controls/tests/TestCases.HostApp/Issues/Issue26945.cs:6
- The class name 'Issue26857' appears to be a typo. It should be renamed to 'Issue26945' to match the issue being addressed.
public class Issue26857 : ContentPage
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
switch (toPosition) | ||
{ | ||
case ScrollToPosition.Start: | ||
ListView.ScrollTo(ListView.SelectedItem, ScrollToPosition.Start, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could modify the sample using for example, a CheckBox, to use the ScrollTo method with the animated parameter using true and also false values?
Issue Details
The ListView.ScrollTo method fails to correctly scroll the selected item to the center or end of the ListView on the Windows platform. Instead, the scroll position always remains at the start and does not align the SelectedItem with the center or end of the list, especially when using it without animation.
Root Cause
The scroll position is reset before scrolling the ListView item (center or end) when using it without animation.
Description of Change
Scroll the ListView item (center or end) before resetting the scroll position value.
Validated the behavior in the following platforms
Issues Fixed
Fixes #26945
Output ScreenShot
BeforeFixWithoutAnimation.mp4
AfterFixWithoutAnimation.mp4