fix(Android, FormSheet v5): Move the sheet above the keyboard - #4573
fix(Android, FormSheet v5): Move the sheet above the keyboard#4573t0maboro wants to merge 6 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughChangesThe Android FormSheet implementation now accounts for IME insets, animates keyboard-driven sheet translation, and preserves the current translation during dismissal. A new scenario covers keyboard behavior for detent-based and FormSheet keyboard handling
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: ⚪ Minimal · up to The change updates Android FormSheet behavior to move sheet content above the software keyboard during keyboard animations. No concrete merge-blocking risk is identified in the supplied context. Sequence Diagram(s)sequenceDiagram
participant FormSheetPresentationManager
participant FormSheetPresentation
participant FormSheetKeyboardCoordinator
participant WindowInsetsAnimation
FormSheetPresentationManager->>FormSheetPresentation: enable keyboard tracking
FormSheetPresentation->>FormSheetKeyboardCoordinator: setup
FormSheetKeyboardCoordinator->>WindowInsetsAnimation: install IME callback
WindowInsetsAnimation->>FormSheetKeyboardCoordinator: report IME progress
FormSheetKeyboardCoordinator->>FormSheetPresentation: update sheet translation
FormSheetPresentationManager->>FormSheetPresentation: disable tracking during dismissal
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 13.04% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 23 functions across 10 files. (1 skipped: 1 unsupported.)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds Android FormSheet keyboard-inset handling and a manual cross-platform test scenario.
Changes:
- Tracks IME insets and animates sheet translation with the keyboard.
- Constrains sheet content to the safe area.
- Adds and registers a keyboard integration test scenario.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
apps/.../scenario.md |
Documents manual keyboard tests. |
apps/.../scenario-description.ts |
Defines scenario metadata. |
apps/.../test-form-sheet-keyboard/index.tsx |
Implements the test screen. |
apps/.../form-sheet/index.ts |
Registers the scenario. |
FormSheetPresentationManager.kt |
Toggles keyboard tracking by presentation state. |
FormSheetPresentation.kt |
Integrates the keyboard coordinator. |
FormSheetAnimatorFactory.kt |
Dismisses from the current translation. |
FormSheetDetents.kt |
Caps content to safe-area height. |
FormSheetCoordinatorHost.kt |
Removes trailing whitespace. |
FormSheetKeyboardCoordinator.kt |
Animates sheet movement with IME transitions. |
FormSheetDimensionsCoordinator.kt |
Incorporates IME insets into geometry. |
FormSheetBehaviorController.kt |
Updates inset documentation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
7ae7160 to
dba2aad
Compare
b241b8e to
af1b60e
Compare
f3f4220 to
92565a5
Compare
LKuchno
left a comment
There was a problem hiding this comment.
Looks good, I left just one suggestion for Android part to avoid confusion what is expected.
|
|
||
| 3. Tap "Top input". | ||
|
|
||
| - [ ] The keyboard slides in and the sheet moves up by the keyboard height, following the keyboard animation – no jump before or after it. "Top input" is focused and visible. |
There was a problem hiding this comment.
Actually currently when keyboard is extended "Bottom input" and "Dismiss from JS".
Screen.Recording.2026-09-02.at.13.38.57.mov
If this is expected I would add information in this step about this.
|
|
||
| 4. Press the system back button (or use the back gesture). | ||
|
|
||
| - [ ] The keyboard hides and the sheet moves back down together with it, settling at the lower detent (0.6). The sheet stays presented. |
There was a problem hiding this comment.
Note that: "Bottom input" and "Dismiss from JS" are not visible again.
LKuchno
left a comment
There was a problem hiding this comment.
LGTM!
You can remove 'On Android' as updated steps are under '## Steps - Android'.
Co-authored-by: lkuchno <45803783+LKuchno@users.noreply.github.com>
Description
FormSheeton Android ignored the software keyboard so far. The sheet should move up its content by the keyboard height following the keyboard animation.Closes: https://github.com/software-mansion/react-native-screens-labs/issues/1276
Changes
FormSheetDimensionsCoordinatortracks the IME inset and resolves the geometry againstmax(systemBars.bottom, ime.bottom)moving the content above the keyboard/navigation baravailable - top - bottom), so content taller than the remaining space no longer overflows the sheet surface.FormSheetKeyboardCoordinatorwas introduced defining our ownWindowInsetsAnimationCompat.Callback. It records the sheet's layouttopbefore the keyboard insets are applied, translates the sheet back there once the end-state layout is in place and drivestranslationYto zero along the keyboard animation. Tracking is enabled byFormSheetPresentationManageronly while the sheet rests inPRESENTED, otherwise the enter/exit animators own that translation.Before & after - visual documentation
keyboard-android.mov
keyboard-ios.mov
Test plan
Added a dedicated SFT (maybe it should be CIT 🤔).
Checklist