feat: fix show soft input on focus behavior (#35244)#52
Conversation
|
@christianwen Can you follow the PR tempate and update it. |
@Santhosh-Sellavel done! thanks for highlighting |
|
cc: @iwiznia |
|
@iwiznia bump again! |
|
Yes yes, I am on it, I just don't work on weekends 😄 |
|
Ah, it was on weekend right 😅 ! |
|
cc: @christianwen |
|
@iwiznia Reinitiate the workflow, also changes didn't touch anything specific to android |
|
ok, re-running. If it fails, let's try merging main to this branch |
|
It failed again... @christianwen can you try merging main into this branch please? |
|
@iwiznia it says "Already up to date." when I try to merge main into my branch. Also the latest update on main was from Jan 19, while I branched out from main only a few days ago so I think my branch is up to date. |
|
Ah then no idea, can you investigate the failure? |
|
hmmm good question, maybe not? I am not sure... @roryabraham I see you on that other PR, is |
|
@iwiznia Now the correct branch to target should be ExpensifyRC1-0.72.0-alpha.0 |
|
@christianwen can you change the target branch then? |
The base branch was changed.
faadd01 to
33ce1f4
Compare
|
If |
|
We are working to upgrade E/App to 0.72.0 as soon as we can. |

Upstream PR Link
facebook#35244
I'm cherry-picking this commit from the React Native upstream repo,
mainbranch. This is tagged for the0.72.0release so should be out soon.This is needed so we can move forward with this issue.
Summary
The
showSoftInputOnFocusofTextInputis not working properly. When we setshowSoftInputOnFocusto false and subsequently totrue, it fails to open the keyboard, we have to re-focus on the input in order for the keyboard to show. It's expected that the keyboard will be opened as soon asshowSoftInputOnFocusbecomestrue. This happens on iOS only.Reference in React Native doc: https://reactnative.dev/docs/textinput#showsoftinputonfocus.
Changelog
[iOS] [Fixed] - Fix issue where keyboard does not open when
TextInputshowSoftInputOnFocuschanges fromfalsetotrueTest Plan
I've made a clean
create-react-native-apprepo to demonstrate this https://github.com/christianwen/reduced-rn-app.Here's the steps:
yarn installcd ios, thenpod install, thencd ..yarn iosshowSoftInputOnFocusisfalse, 3 seconds later it becomestruedue to asetTimeoutthat is usedScreen.Recording.2022-11-07.at.23.42.11.mov
However, it can be seen that the keyboard does not open even though
showSoftInputOnFocusbecomestrue6. Now add the change in this PR to
Libraries/Text/TextInput/RCTBaseTextInputView.m7. Run
yarn iosagain8. Now verify the step 5 again, the keyboard will open automatically when
showSoftInputOnFocusbecomestrueSimulator.Screen.Recording.-.iPhone.14.-.2022-11-07.at.23.32.01.mp4
The reason why I created a fresh RN repo instead of using
rn-testerapp is because theshowSoftInputOnFocusexample is not working inrn-testerapp for some reasons (it shows the keyboard even thoughshowSoftInputOnFocusisfalsein the example).Regarding the code, it's similar to the fix for
keyboardTypein facebook@8baaacb.