Support a header-sized detent #727
Closed
erickreutz
started this conversation in
Ideas
Replies: 1 comment
-
|
#728 added |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
We have a sheet with a compact summary header, scrollable detail content, and a footer. The collapsed detent should fit the header while a second detent exposes the full scrollable content.
autocannot represent this layout because it resolves from the full content height plus the header height. Numeric detents require consumers to:onLayout.detentsafter mount.Fabric synchronous measurement can hide some React layout corrections, but the header must still be committed before it can be measured. TrueSheet already owns the native header layout, so it is better positioned to resolve this detent before initial presentation.
Proposed API
One possible API:
Exact naming is open, but the new detent would:
headerslot rather than total content height.initialDetentIndex={0}, without a JS measurement pass or initial resize.Existing implementation seam
In 3.11.3, both native implementations already track
contentHeightandheaderHeightindependently:contentHeight + headerHeight.contentHeight + headerHeight + contentBottomInset.A header-sized detent could use the existing measured
headerHeightwith a separate detent sentinel, while leavingautobehavior unchanged.This would support a common bottom-sheet pattern: a dynamic collapsed summary above a separately scrollable expanded body, without hard-coded heights or JS layout synchronization.
Beta Was this translation helpful? Give feedback.
All reactions