Skip to content

feat(swmansion): apply keyboardBehavior="inset" to fixed-height sheets#29

Merged
arekkubaczkowski merged 1 commit into
mainfrom
feat/keyboard-inset-fixed-height
Jun 4, 2026
Merged

feat(swmansion): apply keyboardBehavior="inset" to fixed-height sheets#29
arekkubaczkowski merged 1 commit into
mainfrom
feat/keyboard-inset-fixed-height

Conversation

@arekkubaczkowski

Copy link
Copy Markdown
Owner

What

keyboardBehavior="inset" previously only worked on content-sized sheets — it was gated by needsKeyboardInset = keyboardBehavior === 'inset' && !shouldFill, so on numeric-detent / fullHeight sheets it was a silent no-op.

This drops the !shouldFill gate so 'inset' applies to every sheet size:

  • Content-sized sheet → re-measures taller; the added strip hides behind the keyboard (unchanged behaviour).
  • Fixed-height sheet (numeric detents / fullHeight) → the content area shrinks by the keyboard height, so a scrollable child scrolls within the remaining space above the keyboard.

The inset wrapper already received fillStyle (flex: 1), so fixed-height content shrinks correctly with no further change.

Why

Consumers with full-height sheets had to hand-roll keyboard avoidance (nesting a keyboard-aware scrollable), which then double-lifted content on content-sized sheets. With 'inset' working uniformly, the sheet owns keyboard avoidance for all sizes and the content stays a plain scrollable.

Docs

built-in-adapters/swmansion.md gets a dedicated Keyboard avoidance section: how 'inset' adapts per sheet size, when to use 'inset' vs 'none', and the rule that the two are exclusive (never nest a keyboard-aware scrollable inside an 'inset' sheet).

Previously the keyboard inset was gated to content-sized sheets
(`!shouldFill`), so `keyboardBehavior="inset"` was a no-op on
numeric-detent / fullHeight sheets.

Now it applies to every sheet size: content-sized sheets re-measure
taller, while fixed-height ones shrink their scroll area above the
keyboard (the inset wrapper already carries fillStyle / flex:1).

Docs updated with a dedicated Keyboard avoidance section and inset vs
none guidance.
@arekkubaczkowski arekkubaczkowski merged commit a8465a2 into main Jun 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant