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 the ListView scroll position center and end without animation #27001

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

Conversation

Shalini-Ashokan
Copy link
Contributor

@Shalini-Ashokan Shalini-Ashokan commented Jan 8, 2025

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

  • Android
  • Windows
  • iOS
  • Mac

Issues Fixed

Fixes #26945

Output ScreenShot

Before After
BeforeFixWithoutAnimation.mp4
AfterFixWithoutAnimation.mp4

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Jan 8, 2025
Copy link
Contributor

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.

@Shalini-Ashokan
Copy link
Contributor Author

@dotnet-policy-service agree company="Syncfusion, Inc."

@karthikraja-arumugam karthikraja-arumugam added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Jan 8, 2025
@Shalini-Ashokan Shalini-Ashokan marked this pull request as ready for review January 8, 2025 11:13
@Shalini-Ashokan Shalini-Ashokan requested a review from a team as a code owner January 8, 2025 11:13
@jfversluis
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen requested a review from Copilot January 8, 2025 18:05

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 to Issue26945Test_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
@jfversluis jfversluis added the area-controls-listview ListView and TableView label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-listview ListView and TableView community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ListView ScrollTo position always remains at the start even when set to Center or End without animation
3 participants