Skip to content

Conversation

@praveenkumarkarunanithi
Copy link
Contributor

PR - #30629 Failing test case details :

Root Cause

The root cause of the layout freeze on iPhone XS is a microscopic floating-point precision error in UIKit’s SafeAreaInsets reporting. Instead of returning a clean zero, iPhone XS provides a non-zero value (3.5527136788005009e-15) for the left inset.
This value is treated by the layout system as a legitimate inset change, triggering a layout re-evaluation. Since the value never stabilizes to an exact zero, the system enters an infinite layout loop.
Other iPhone models such as iPhone 11 and iPhone 16 return precise {0,0,0,0} insets and are not affected.

Description of Change

This change applies a strict floating-point threshold (1e-14) to treat such negligible values as zero before passing them into the layout system. The chosen tolerance is precise enough to eliminate false positives without suppressing valid sub-pixel safe area insets on high-resolution displays.
This ensures stable layout behavior across devices while preserving layout precision for real safe area adjustments.

Issues Fixed

Fixes #30629 failing test case - LabelShouldSizeProperlyOnCollectionView

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Output Video

Before Issue Fix After Issue Fix
BeforeFix.mov
AfterFix.mov

@dotnet-policy-service dotnet-policy-service bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Jul 17, 2025
@praveenkumarkarunanithi praveenkumarkarunanithi marked this pull request as ready for review July 17, 2025 12:55
@praveenkumarkarunanithi praveenkumarkarunanithi requested a review from a team as a code owner July 17, 2025 12:55
@praveenkumarkarunanithi praveenkumarkarunanithi requested review from StephaneDelcroix and jfversluis and removed request for a team July 17, 2025 12:55
@PureWeen PureWeen merged commit f43e5cc into dotnet:PureWeen/safe-area-fixes-ios-net10 Jul 17, 2025
1 check passed
PureWeen added a commit that referenced this pull request Jul 17, 2025
…eProperlyOnCollectionView (#30682)

* Fix SafeArea management on iOS

* Fixed the SafeArea branch test case failures issues (#30622)

* Fixed the SafeArea test case issues and 22417(mac) main issue

* Removed the Fails condition on Mac

* Enhance CrossPlatformArrange method to support safe area adjustments and improve RTL layout handling

* - add images and fix naming

* - additional image updates

* - add comments

* fix update.

---------

Co-authored-by: Shane Neuville <[email protected]>
Co-authored-by: Ahamed-Ali <[email protected]>
PureWeen added a commit that referenced this pull request Jul 17, 2025
…eProperlyOnCollectionView (#30682)

* Fix SafeArea management on iOS

* Fixed the SafeArea branch test case failures issues (#30622)

* Fixed the SafeArea test case issues and 22417(mac) main issue

* Removed the Fails condition on Mac

* Enhance CrossPlatformArrange method to support safe area adjustments and improve RTL layout handling

* - add images and fix naming

* - additional image updates

* - add comments

* fix update.

---------

Co-authored-by: Shane Neuville <[email protected]>
Co-authored-by: Ahamed-Ali <[email protected]>
github-actions bot pushed a commit that referenced this pull request Jul 18, 2025
…eProperlyOnCollectionView (#30682)

* Fix SafeArea management on iOS

* Fixed the SafeArea branch test case failures issues (#30622)

* Fixed the SafeArea test case issues and 22417(mac) main issue

* Removed the Fails condition on Mac

* Enhance CrossPlatformArrange method to support safe area adjustments and improve RTL layout handling

* - add images and fix naming

* - additional image updates

* - add comments

* fix update.

---------

Co-authored-by: Shane Neuville <[email protected]>
Co-authored-by: Ahamed-Ali <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators Aug 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants