Skip to content

iOS formSheet fitToContents includes header height when header is transparent #4276

Description

@Ubax

Description

When using a formSheet with sheetAllowedDetents: 'fitToContents' on iOS, setting the native header to transparent appears to leave extra unused height in the sheet.

With an opaque header, the sheet fits the header plus content. With a transparent header, the header overlays the content as expected, but the sheet still appears to reserve the native header height, leaving dead space below the content.

Image Image

In the transparent example you can see space below elements which is inset + header

Native context:

Looking at the iOS implementation, fitToContents is based on the RNSScreenContentWrapper frame height, then adjusted by contentHeightErrata.

That errata is accumulated while walking parent view controllers and adds the height of visible RNSNavigationController.navigationBar instances. The check appears to account for navigationBar.isHidden, but not whether the header is transparent.

Steps to reproduce

  1. Clone and run the reproduction repository.
  2. Open the "Opaque header" sheet.
  3. Open the "Transparent header" sheet.
  4. Open the "Transparent + header padding" sheet.
  5. Compare the sheet content and the empty space below the last row.

Snack or a link to a repository

https://github.com/fabriziocucci/sheet-header-transparent-repro

Screens version

4.25.2

React Native version

0.86.0

Platforms

iOS

JavaScript runtime

Hermes

Workflow

Expo managed workflow

Architecture

Fabric (New Architecture)

Build type

Debug mode

Device

iOS simulator

Device model

iPhone 17 Pro Max simulator, iOS 26.2, Xcode 26.2

Acknowledgements

Yes

Metadata

Metadata

Assignees

Labels

missing-reproThis issue need minimum repro scenarioplatform:iosIssue related to iOS part of the library

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions