Skip to content

fix(ios): hide the presenter's keyboard under a custom-dimmed sheet - #925

Merged
lodev09 merged 2 commits into
mainfrom
fix/ios-custom-dim-keyboard
Oct 13, 2026
Merged

lodev09 merged 2 commits into
mainfrom
fix/ios-custom-dim-keyboard

Conversation

@lodev09

@lodev09 lodev09 commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Summary

Since #911, focusing an input and then presenting a stacked sheet with dimColor or dimOpacity set no longer hides the keyboard on iOS. Native behavior (and v3) hides it while the sheet is up and brings it back on dismiss.

UIKit only does this for a sheet dimmed at every detent (largestUndimmedDetentIdentifier == nil). Custom dimming turns the native dim off by marking every detent undimmed, so UIKit skips it.

The fix does the same thing UIKit does, but only for custom-dimmed sheets dimmed at every detent:

  • On present, the input focused in the view below loses focus.
  • When the dismiss commits, the input is focused again: right away for dismiss() or a dim tap, and on release for a swipe. A swipe that snaps back does nothing, as in UIKit.

Sheets with dimmedDetentIndex > 0 or dimmed={false} keep the keyboard up, same as native.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Test Plan

Bare example, iPhone 18 Pro Max simulator (iOS 27). Focus the main sheet's header input, then tap "TrueSheet View" (BasicSheet uses dimColor).

  • Before: keyboard stays up over the basic sheet. With dimColor/dimOpacity removed, it hides, which confirms the cause.
  • After: keyboard hides on present.
  • Swipe the basic sheet down and back up: keyboard stays hidden.
  • Swipe it away: keyboard comes back with the input focused, and the main sheet rises with it.
  • Present again, tap the dim: same as the swipe.

Checklist

  • I tested on iOS
  • I tested on Android
  • I tested on Web
  • I updated the documentation (if needed)
  • I added a changelog entry (if needed)

@vercel

vercel Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
react-native-true-sheet Ready Ready Preview Oct 13, 2026 3:14pm UTC

Request Review

@lodev09
lodev09 merged commit cadb6db into main Oct 13, 2026
6 checks passed
@lodev09
lodev09 deleted the fix/ios-custom-dim-keyboard branch October 13, 2026 15:15

This branch was successfully deployed

1 active deployment
Preview — 39d4af65 Deployed Oct 13, 2026 by vercel[bot]
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