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

Open
wants to merge 6 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
@karthikraja-arumugam karthikraja-arumugam added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Dec 27, 2024
@devanathan-vaithiyanathan devanathan-vaithiyanathan marked this pull request as ready for review January 2, 2025 09:34
@devanathan-vaithiyanathan devanathan-vaithiyanathan requested a review from a team as a code owner January 2, 2025 09:34
@Redth
Copy link
Member

Redth commented Jan 2, 2025

/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-scrollview ScrollView community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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