-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix: autogrow heigh for TextInput #60842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: autogrow heigh for TextInput #60842
Conversation
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
@parasharrajat 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] |
|
670f5db
to
66a84ca
Compare
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2025-05-06.at.05.59.40.android.movAndroid: mWeb ChromeScreen.Recording.2025-05-06.at.05.56.47.android.chrome.moviOS: NativeScreen.Recording.2025-05-06.at.06.05.42.moviOS: mWeb SafariScreen.Recording.2025-05-06.at.06.03.09.ios.safari.movMacOS: Chrome / SafariScreen.Recording.2025-05-06.at.05.52.21.web.movMacOS: DesktopScreen.Recording.2025-05-06.at.05.54.28.desktop.mov |
@Nodonisko, which changes in the PR we almost reverted to what we did in the previous PR. I'm curious about how we will migrate both Android/IOS to native auto grow later, when upstream issues are fixed in Android?
|
@hoangzinh Yes, fix input in RN and then migrate to native auto grow. It will be basically just about returning that |
@Nodonisko, do you mean the fix of auto grow is also not merged/fixed in IOS atm? I tried returning |
I meant that right now both iOS and Android use the same ("old way") method to handle auto-grow, where we measure the layout using TextInputMeasurement. The new way is to just use the native auto-grow feature. On iOS, both old and new ways basically feel the same for the user. If you tried replacing The old way is more complicated and less efficient internally, but users won't really notice any lag or difference on iOS. The problem is, using the new way only for iOS and keeping the old way for Android would add quite a few extra ifs in Later, once we fix the actual issue inside RN's TextInput, we can simply remove that TextInputMeasurement component and those few styles, and it will work the new way. Is it clear now? Feel free to ask additional questions. |
It's clearer now. Thanks @Nodonisko. Do you mind sharing what |
@hoangzinh here |
@Nodonisko I tried to apply the above suggestion, but it doesn't work. Did I miss any steps? Screen.Recording.2025-04-29.at.21.03.26.mov |
@Nodonisko @hoangzinh what are the next steps for this one? |
@hoangzinh Sorry my bad. I was testing only width grow and it won't be that easy for height and it will need more style adjustments. I can prepare them for you but it will take a while. I suggest to merge this now to resolve original issue and then I can prepare some draft PR that can be merged once it's TextInput fixed in RN. |
Sound good to me. I will complete review checklist today |
@Nodonisko can you please add Screenshots/Videthe os for remaining platforms? |
66a84ca
to
62f307d
Compare
Hi, sorry I was on holiday last week. Screenshots added and also rebased to latest main. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/aldo-expensify in version: 9.1.45-0 🚀
|
🚀 Deployed to staging by https://github.com/aldo-expensify in version: 9.1.45-0 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 9.1.45-21 🚀
|
Explanation of Change
I decided put back
onLayout
measuring on iOS introduced in #59078. It doesn't make sense to branch it for Android/iOS because with fix forautoGrowHeigh
it would add too much complexity toBaseTextInput
component for very little benefit of smaller overhead on iOS. WithonLayout
back it should fixautoGrowHeigh
.Once
TextInput
component on Android is fixed properly upstream we should migrate both Android/iOS to native auto grow to avoid onLayout overhead inBaseTextInput
.Fixed Issues
$ #60765
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop