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 ScrollToPosition.Center behavior in ScrollView on iOS and MacCatalyst #26825

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

Conversation

devanathan-vaithiyanathan
Copy link
Contributor

@devanathan-vaithiyanathan devanathan-vaithiyanathan commented Dec 26, 2024

Issue Details

When scrolling a ScrollView using the ScrollToAsync method with the ScrollPosition.Center value, the item is incorrectly centered.

Root Cause

The scroll offset values allow items to scroll into a negative position, causing the item to be incorrectly centered.

Description of Change

We clamp the scroll offset values to ensure the item does not scroll into a negative position.

Issues Fixed

Fixes #26760

Validated the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Output Screenshot

Before After
BeforeFix-IOS.mp4
AfterFix-IOS.mp4

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

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

@karthikraja-arumugam karthikraja-arumugam added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-scrollview ScrollView community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ScrollToPosition.Center Centers the First Item too in iOS and Catalyst
4 participants