Skip to content

[iOS] Fix extra bottom space in ScrollView when using SafeAreaEdges#30976

Merged
PureWeen merged 2 commits intodotnet:net10.0from
Tamilarasan-Paranthaman:Net10-Testing
Aug 4, 2025
Merged

[iOS] Fix extra bottom space in ScrollView when using SafeAreaEdges#30976
PureWeen merged 2 commits intodotnet:net10.0from
Tamilarasan-Paranthaman:Net10-Testing

Conversation

@Tamilarasan-Paranthaman
Copy link
Copy Markdown
Member

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Root Cause of the Issue:

  • The issue was caused by a race condition between KeyboardAutoManagerScroll and the ScrollView’s SafeAreaEdges.SoftInput logic. The KeyboardAutoManagerScroll executed before the layout adjustments for SafeAreaEdges.SoftInput, resulting in padding being applied without considering the updated safe area values. As a result, extra/unwanted padding was added below the bottom of the ScrollView.

Description of Change

  • To resolve this, a consistent 30ms delay is now applied to all input controls within the KeyboardAutoManagerScroll logic. Previously, the delay was applied only when the InputAccessoryView was present. This change ensures that KeyboardAutoManagerScroll executes after layout updates, based on the recalculated layout. As a result, it maintains consistent behavior and prevents conflicts between the scrolling logic and SafeAreaEdges.SoftInput adjustments.

Screenshot

Before Fix After Fix
Before-Fix.mov
After-Fix.mov

@dotnet-policy-service dotnet-policy-service bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Aug 1, 2025
@Tamilarasan-Paranthaman Tamilarasan-Paranthaman marked this pull request as ready for review August 1, 2025 14:45
Copilot AI review requested due to automatic review settings August 1, 2025 14:45
@Tamilarasan-Paranthaman Tamilarasan-Paranthaman requested a review from a team as a code owner August 1, 2025 14:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a race condition in iOS ScrollView that caused extra bottom spacing when using SafeAreaEdges. The issue occurred when KeyboardAutoManagerScroll executed before SafeAreaEdges.SoftInput layout adjustments, leading to incorrect padding calculations.

  • Applies a consistent 30ms delay to all input controls in KeyboardAutoManagerScroll
  • Ensures proper timing coordination between keyboard auto-scroll and safe area adjustments
  • Prevents conflicts that previously caused double padding or incorrect positioning

Comment thread src/Core/src/Platform/iOS/KeyboardAutoManagerScroll.cs
Comment thread src/Core/src/Platform/iOS/KeyboardAutoManagerScroll.cs
@PureWeen
Copy link
Copy Markdown
Member

PureWeen commented Aug 1, 2025

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen added this to the .NET 10.0-preview7 milestone Aug 1, 2025
@PureWeen PureWeen moved this from Todo to Approved in MAUI SDK Ongoing Aug 1, 2025
Copy link
Copy Markdown
Member

@PureWeen PureWeen left a comment

Choose a reason for hiding this comment

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

GridStarRowScrollingTest is failing

Can you check if the test just needs to be fixed?

@github-project-automation github-project-automation bot moved this from Approved to Changes Requested in MAUI SDK Ongoing Aug 1, 2025
@Tamilarasan-Paranthaman
Copy link
Copy Markdown
Member Author

GridStarRowScrollingTest is failing

Can you check if the test just needs to be fixed?

@PureWeen, this test seems to be failing due to a timing issue. Locally, the Entry sometimes fails to scroll into the correct position when tapped. Slightly increasing the existing delay before requesting the layout to scroll again, after the initial scroll, seems to resolve the issue. Could you please share your thoughts on this?

Screenshot 2025-08-04

@PureWeen
Copy link
Copy Markdown
Member

PureWeen commented Aug 4, 2025

/azp run

@github-project-automation github-project-automation bot moved this from Changes Requested to Approved in MAUI SDK Ongoing Aug 4, 2025
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen
Copy link
Copy Markdown
Member

PureWeen commented Aug 4, 2025

  • failing tests aren't related

@PureWeen PureWeen merged commit ea7078d into dotnet:net10.0 Aug 4, 2025
124 of 129 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in MAUI SDK Ongoing Aug 4, 2025
@PureWeen
Copy link
Copy Markdown
Member

PureWeen commented Aug 5, 2025

/backport to release/10.0.1xx-preview7

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Aug 5, 2025

Started backporting to release/10.0.1xx-preview7: https://github.com/dotnet/maui/actions/runs/16751639340

@github-actions github-actions bot locked and limited conversation to collaborators Sep 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-scrollview ScrollView community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants