Multiline input for name field in report field does not scroll (V2)#81005
Multiline input for name field in report field does not scroll (V2)#81005Julesssss merged 10 commits intoExpensify:mainfrom
Conversation
…d does not scroll" This reverts commit efcc003.
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
…tInput components
src/components/TextInput/BaseTextInput/implementation/index.native.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7df20112b6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Videos look good to me 👍 |
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
V2 after revert
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-02-11.at.10.32.42.mp4Android: mWeb ChromeScreen.Recording.2026-02-11.at.10.34.14.mp4iOS: HybridAppScreen.Recording.2026-02-11.at.10.40.06.mp4iOS: mWeb SafariScreen.Recording.2026-02-11.at.10.41.16.mp4MacOS: Chrome / SafariScreen.Recording.2026-02-11.at.10.23.27.mp4 |
| !hasLabel && styles.pt0, | ||
| textInputContainerStyles, | ||
| (autoGrow || !!contentWidth) && StyleUtils.getWidthStyle(textInputWidth + (shouldApplyPaddingToContainer ? styles.textInputContainer.padding * 2 : 0)), | ||
| (autoGrow || !!contentWidth) && StyleUtils.getWidthStyle(textInputWidth + containerPadding), |
There was a problem hiding this comment.
@mohammadjafarinejad Is this change only required for web? If yes, could you explain why it’s not needed on native?
There was a problem hiding this comment.
On native, the condition to add padding is only !!contentWidth:
But in web, if autoGrow is true, we don’t add extra padding because autoGrowMeasurementStyles already includes it. As a result, textInputWidth ends up including the padding automatically.
I could also write a more detailed comment in the code to explain this difference clearly—would that be helpful?
| ...(paddingLeft && {paddingLeft}), | ||
| ...(paddingRight && {paddingRight}), | ||
| ...(borderLeftWidth && {borderLeftWidth}), | ||
| ...(borderRightWidth && {borderRightWidth}), |
There was a problem hiding this comment.
| ...(paddingLeft && {paddingLeft}), | |
| ...(paddingRight && {paddingRight}), | |
| ...(borderLeftWidth && {borderLeftWidth}), | |
| ...(borderRightWidth && {borderRightWidth}), | |
| ...(paddingLeft !== undefined && {paddingLeft}), | |
| ...(paddingRight !== undefined && {paddingRight}), | |
| ...(borderLeftWidth !== undefined && {borderLeftWidth}), | |
| ...(borderRightWidth !== undefined && {borderRightWidth}), |
This function has a bug when the value is 0
There was a problem hiding this comment.
I think I wrote it intentionally this way because, as you can see here, sometimes we can have zero padding.
If we don’t exclude 0 paddings in autoGrowMeasurementStyles, we could unexpectedly override inputStyle paddings with 0.
App/src/components/TextInput/TextInputMeasurement/index.tsx
Lines 65 to 66 in f741465
I also noticed that if we change the order, some components pass 0 padding to inputStyle, which would then override autoGrowMeasurementStyles.
autoGrowMeasurementStyles,
inputStyle,So basically, we need autoGrowMeasurementStyles to include all horizontal non-zero paddings to avoid overwriting inputStyle paddings.
Could you please provide reproduction steps for the bug?
|
@mohammadjafarinejad Please sync with the main branch. |
|
@huult Done |
|
🚧 @Julesssss has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/Julesssss in version: 9.3.18-0 🚀
|
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.3.18-8 🚀
|
Explanation of Change
Original PR: #77324
Fixed Issues
$ #76785
PROPOSAL: #76785 (comment)
Tests
A scroll is displayed to show all the input by scrolling down, OR
The user can view the far right by navigating right
Verify TrackDistance, CreateExpense, and other places in the app where we use InputField, and make sure the functionality remains intact.
Verify that no errors appear in the JS console
Offline tests
Same as tests.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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
android.mp4
Android: mWeb Chrome
android-web.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
ios-web.mp4
MacOS: Chrome / Safari
web-safari.mp4
web-chrome.mp4