Repository navigation
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@ChavdaSachin Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
| const availableHeightRef = useRef<number>(variables.textInputAutoGrowMaxHeight); | ||
| const viewportHeightRef = useRef(windowHeight); | ||
| const keyboardHeightRef = useRef(nativeKeyboardHeight); | ||
| const lastExactContainerHeightRef = useRef<number | null>(null); |
There was a problem hiding this comment.
❌ CONSISTENCY-1 (docs)
const isNativePlatform = Platform.OS !== 'web'; gates a large amount of platform-specific behavior inside this single component: the native keyboard-height math (lines 50-51), the native-only branches in the two useLayoutEffects, and the extensive native layout-reconciliation block inside onLayout (lines 160-202). Mixing web and native code paths in one component increases complexity and platform-specific bug risk.
Consider splitting the platform-divergent logic into AutoGrowHeightInputContainer.native.tsx / AutoGrowHeightInputContainer.tsx (web) variants, or extracting the native keyboard/layout reconciliation into a platform-suffixed helper, so each platform's behavior lives in its own file rather than behind isNativePlatform branches.
Reviewed at: c068309 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
There was a problem hiding this comment.
Thanks for flagging this. I left the shared file intentionally. CONSISTENCY-1 is defined around hardcoded platform values or styles, while this code uses the platform check to reconcile coupled keyboard and layout events whose ordering differs across web and native. Splitting this stabilization state machine would duplicate or desynchronize shared ordering logic and carries disproportionate regression risk, so I’m keeping the platform paths together for this PR. The focused tests cover the native and web transition paths, and I’m leaving this thread open for the design discussion.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 34940f135c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppScreen.Recording.2026-10-30.at.6.50.12.AM.moviOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-10-30.at.5.23.14.AM.mov |
…auto-grow-inputs # Conflicts: # src/pages/iou/request/step/DynamicIOURequestStepDescription.tsx
Restarting the clamp at the full slot on every ignored layout grew a filled input past the slot, and the probe that followed shrank it to one row, so its bottom border jumped while the keyboard closed.
…timate Forms reserve 70% of the bottom inset on iOS. Subtracting the whole inset left the slot about 10pt too tall until keyboardDidShow, so the input shrank again after iOS had scrolled the caret into view, and the caret line was cut off.
|
@Krishna2323 thanks for testing. I tested each one on main and on this PR (iPhone 17 simulator iOS 26.5, Android API 36 emulator). This PR caused 1, 3 and 4; they're fixed in 32f3d3e. 2 and 5 happen on main too. Main is also merged again to fix the conflicts. 1. iOS Safari: tap outside the input with the keyboard open (fixed) I couldn't get the page to drop to the middle on iOS 26.5, but the same tap shows the bug behind it. With this PR, the empty space under the input is the auto-grow container, which holds the input. Safari's tap first blurs the input, then puts the caret back into the nearest text inside the tapped box, so the input gets focus again and the keyboard stays open. The blur still runs the form's Safari blur handler, which about a second later lays the page out at full height behind the open keyboard. That's when Save disappears, and probably the jump you saw on iOS 27.2. On main that space is an empty spacer outside the input, so the tap is a normal blur. The container's empty space is now not selectable, so the tap blurs the input as it does on main. The input and its messages stay selectable. 6 of 6 runs were clean. 1-ios-safari-tap-below-input.mp42. iOS Safari: Save stays up after saving This also happens on main, where it lasts longer: the keyboard closes and Save stays up with the spinner for about 2.1 s on main, versus about 0.6 s on this PR. Since main already does it, I left it out of this PR. 2-ios-safari-save-main-vs-pr.mp43. iOS native: caret line hidden at the bottom (fixed) While the keyboard opens, the container estimates its height. The estimate took away the whole bottom safe area, but forms only reserve 70% of it on iOS, so the estimate was about 10pt too tall. iOS scrolled the caret into view at that height; then the input shrank to its real size and the caret line ended up below the box. The estimate now uses the same safe-area padding as the form, so the size is right from the start. This also fixes an input that stayed at two lines when the app opened straight onto the page. 3-ios-caret-line.mp44. iOS native: border jumps when the keyboard closes (fixed) While the keyboard animates, the container skips some layout updates, but it still restarted its measurement at the full height on each one. A filled input grew past its space, then shrank to one row and grew back, several times during one close. It now keeps the measured height while the keyboard animates and only measures again when the width changes. 4-ios-border-on-keyboard-close.mp45. Android: first line flickers on each new line This also happens on main: on each Return, Android's text field scrolls before React Native updates its height, so the first line is blank for 1–3 frames. The container doesn't measure again on a new line here. With this PR you see it on more lines only because the input keeps growing past main's 115px limit. 5-android-new-line-main-vs-pr.mp4 |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid_hybrid_26.mp4Android: mWeb Chromeandroid_mWeb.mp4iOS: HybridAppios_hybrid.mp4iOS: mWeb Safariios_mWeb.mp4MacOS: Chrome / Safariweb_chrome_2.mp4web_chrome.mp4 |
Krishna2323
left a comment
There was a problem hiding this comment.
LGTM!
@KJ21-ENG could you please resolve the conflicts? Thanks!
…auto-grow-inputs # Conflicts: # src/components/Form/types.ts
FilterPopupButton read visualViewport.offsetTop only on resize. iOS Safari can fire the keyboard resize before it scrolls the page to the focused input, so the sheet kept marginTop 0 with maxHeight set to the shrunk viewport and sat one keyboard height too high. Use useViewportOffsetTop, which also follows visualViewport scroll.
|
@Krishna2323 thanks for the approval. I merged main again (conflict in
A1-wide-compare.mp4
L1a-desktop-compare.mp4
S1-compare-4up.mp4@grgia one design question before merge: on four screens the helper content now sits at the bottom, above the action, instead of right under the input, because the input takes the space in between. Is that OK, or should it stay under the input?
|
@KJ21-ENG no to this one. That would become a regression, could we match main? |
Default report title examples, the Merchant to match type row, the description hint tip and the reject previous-approver choice now render inside the measured content, so they sit under the input as on main and the input only grows into the space below them.
|
@grgia done. The helper content is back right under the input, as on main:
The input still grows, but only into the space below the helper, so the helper and the button stay visible.
Each image shows main, this PR before the change, and this PR now. With a long value, the input fills the space above the helper (normal and short window): |
…eps caching the form
|
@grgia @Krishna2323 one Android behaviour to flag before you sign off, so it isn't a surprise in QA. What happens: on Android, when the keyboard opens on a long value, the input is too tall for a moment. For about 0.2–0.5 s it hides its label, its last line and the helper under it (for example the Pro-tip), then it settles with everything visible. On some opens the input first shrinks to about 2 rows for up to 0.35 s, then grows back. iOS native and web don't do this. Why: the input works out its new height a few frames after Android shrinks the panel for the keyboard, so for that moment it still has the height it had before. This affects every input in this PR that grows, including screens that have no helper, such as Workspace description. Now that the helper sits right under the input, as on main, the short overlap is easier to see. Compared with main: main has its own blink at the same moment. On some keyboard opens the whole page is blank for 0.3–0.47 s. The video plays both side by side (Description hint, slow motion, then real speed): android-keyboard-gap-explained.mp4Times come from an Android emulator running production-mode JS, over 3 keyboard opens per screen. On a dev build the same gap is 1.7–4.3 s, so it will look much bigger there.
I tried one fix: on a height-only change, the input keeps the space the helper already has. It shortened the gap on Match type but made it longer on Default report title, so I didn't push it. Removing the gap fully would mean resizing the input in the same pass as the keyboard, which is a bigger change to the shared container. Are you OK with this as is, or would you like me to work on removing it in this PR? |
| maxAutoGrowHeight={maxAutoGrowHeight} | ||
| /> | ||
| </View> | ||
| {/* The approver choice stays right under the input, inside the measured content, so the input only grows into the space left below it. */} |
There was a problem hiding this comment.
NAB
an approver on a small phone sees one line of their rejection reason while typing it, where main shows four.
with the keyboard open and a long reason the input drops to one row at 375x667 and 360x640, and three rows at 390x844. is that intended now the approver choice sits inside the measured content? checked in Chrome phone emulation with the window shortened for the keyboard, not on a device.
There was a problem hiding this comment.
@grgia not intended, thanks for catching it. Fixed in 2e26224: content under the input can no longer squeeze it below main's cap (115px, about four lines). Whatever doesn't fit scrolls inside the panel, and the Reject report button stays visible.
Same check as yours (Chrome, window shortened by ~260px for the keyboard, long reason):
| Size | main | before | now |
|---|---|---|---|
| 375x407 | 4 rows | 1 row | 4 rows |
| 360x380 | 4 rows | 1 row | 4 rows |
| 390x584 | 4 rows | 6 rows | 6 rows |
The same rule covers the other screens with content under the input. On Default report title at 375x407 the input now keeps 4 rows instead of 3, so the last example needs a short scroll. On main you also scroll there, to reach Save.
… less room On a short screen with the keyboard open, the approver list on Reject report left one row for the rejection reason, where main shows four. The content that does not fit now scrolls in the slot instead.
|
Reviewing... |
|
@grgia @Krishna2323 please hold this PR for now, don't merge yet. An extra regression pass on 2e26224 found cases on very short screens that I want to fix first:
I'm testing a fix now and will post the results here when it's ready. |
…the input, and count the iOS keyboard once On a short screen the fixed cap left no room for the input's own frame or its error, and below about 300px the slot could not even hold the cap, so markdown boxes were cut, errors were hidden and inputs showed fewer rows than before they could grow. The content below the input also scrolled inside the slot, which has no scrollbar, so the input's label or that content could sit out of view. When the slot cannot hold its content with the input at the fixed cap, it now grows to hold all of it, following the content as errors appear or lines change, and the form scrolls as it did before. A web resize no longer estimates a slot taller than the one laid out. On iOS a screen opened by a link with its input focused laid the slot out at its keyboard-open size about 30ms before the keyboard state updated, so the keyboard was subtracted twice and the input stayed at one row. A settled layout change that matches the keyboard that soon before it is now treated as the keyboard.
|
@grgia @Krishna2323 the hold can be lifted. Fixed in ea52351.
Rows shown in Chrome, with the window shortened for the keyboard ("before" is 2e26224):
This changes what I described earlier for Reject report on a short phone. At 375x407 and 360x380 it now matches main: the approver list shows under the reason, and the Reject report button is below the fold, reached by scrolling. Taller phones and desktop are unchanged. One known difference: on a small Android phone (360x640) with the keyboard open, Reject report sometimes opens with the page scrolled up about 110px, so the field's label sits above the visible area. The input still shows four rows with the caret, the approver list stays visible, and scrolling up shows the label. Main didn't do this in my runs. Tested on Chrome at short heights from 407 down to 240 and in landscape, on the iPhone SE simulator and on an Android emulator at 360x640. |
…auto-grow-inputs # Conflicts: # src/pages/workspace/fields/FieldsInitialValuePage.tsx # src/pages/workspace/taxes/NamePage.tsx








Explanation of Change
Long text in right-hand-panel editors can stop growing while space remains available. A shared container now measures the remaining panel height so opted-in text inputs grow to that limit and scroll internally, while submit controls and supporting content retain their space.
Following the agreed scope expansion, this covers single primary user-written RHP fields: rejection and hold reasons, titles, workspace/chat/card/tag names, descriptions, notes, and rule text. Name and merchant editors wrap visually and normalize pasted line breaks before validation and saving; prose retains paragraphs. Structured fields, multi-input forms, formula/disabled field variants, and global input defaults retain their existing behavior. In Search, the Description and Title filters grow on narrow and wide layouts (the filter page, the Filters popup and the filter chips), as agreed in the issue; Keyword and the other text filters stay compact.
On narrow web layouts, the Search filter-chip sheet now follows the visual viewport's scroll as well as its resize (
FilterPopupButtonuses the existinguseViewportOffsetTophook instead ofwithViewportOffsetTop). In iOS Safari the keyboard can resize the viewport before it scrolls the page to the focused field; the sheet then sat one keyboard height too high, with its field off screen. This already happened on main in some runs; the multi-line Description/Title chip field made it happen most of the time, most likely because the multi-line field changes Safari's keyboard timing. All filter sheets that useFilterPopupButtonget the same positioning; desktop is unchanged.Fixed Issues
$ #95219
PROPOSAL: #95219 (comment)
Tests
Desktop web checks on the updated branch covered policy text, private notes, room/workspace descriptions, workspace names, task titles, default report titles, both rejection editors and the existing narrow/wide Search layouts. Inputs grew to the available-height limit and then scrolled internally; actions and previous-approver controls remained reachable, including through page scrolling where short windows required it. Desktop Enter used the latest typed value, Shift+Enter retained paragraph breaks, and required, length and selection errors kept the editor open. Pasted name line breaks were normalized, and original settings were restored after testing. In Search, Description and Title grew to fill the space above Confirm on both layouts and kept the length error visible; Keyword and the other text filters stayed compact.
Repeat the following checks on the updated branch:
Offline tests
QA Steps
Same as tests and offline tests, using test accounts on each supported platform. Include both rejection entry points, a report with a previous approver, prose and normalized-name editors, help/selector layouts, draft navigation and excluded inputs.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Earlier Search/rejection implementation recording.
Screen.Recording.2026-08-17.at.4.03.39.AM.mov
Android: mWeb Chrome
Earlier Search/rejection implementation recording.
Record_2026-08-15-12-58-41.mp4
iOS: Native
Earlier Search/rejection implementation recording.
Simulator.Screen.Recording.-.iPhone.17.-.2026-08-17.at.02.17.16.compressed.mp4
iOS: mWeb Safari
Earlier Search/rejection implementation recording.
Screen.Recording.2026-08-15.at.1.10.08.PM.mov
MacOS: Chrome / Safari
Desktop web — October 13 update, narrow 390×700 window.
Bounded input growth and desktop Enter/Shift+Enter behavior:
Watch recording
Report/expense rejection-editor scrolling, reachable controls and validation:
Watch recording
Earlier desktop recordings:
Screen.Recording.2026-08-15.at.11.15.37.AM.compressed.mp4
pr98648-selected-web-evidence-1.5x.mp4