fix: Android - Search - Keyboard is not automatically opened despite input being focused.#67297
Conversation
…input being focused. Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
|
@allgandalf 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] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-08-05.at.9.53.38.AM.movAndroid: mWeb ChromeScreen.Recording.2025-08-05.at.9.52.06.AM.moviOS: HybridAppScreen.Recording.2025-08-05.at.9.52.32.AM.moviOS: mWeb SafariScreen.Recording.2025-08-05.at.9.53.17.AM.movMacOS: Chrome / SafariScreen.Recording.2025-07-30.at.12.34.37.PM.movScreen.Recording.2025-08-05.at.9.46.53.AM.movMacOS: DesktopScreen.Recording.2025-07-30.at.12.34.53.PM.mov |
| @@ -1,3 +1,4 @@ | |||
| import {useFocusEffect} from '@react-navigation/native'; | |||
There was a problem hiding this comment.
@Krishna2323 if the original bug was only occurring on native platforms, why do we need to update the non native part ?
There was a problem hiding this comment.
I believe we should be consistent with the focus delay across all platforms, which is why I also added the changes for non‑native platforms. The same approach was taken in the selection list, we didn’t only add the delay for native platforms but for all. Let me know if you think we should remove the non‑native input delay.
There was a problem hiding this comment.
yeah i mean, why are we adding code to fix a problem if it doesn't exist in the first place
There was a problem hiding this comment.
Let's focus on fixing the problem experienced and only add the delay for native, where it is actually needed
There was a problem hiding this comment.
@allgandalf I have updated the non-native file. Please check.
Please address this comment as well |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
bump on above, do we need any action here? |
No action required. |
| // Height fix is needed only for Text single line inputs | ||
| const shouldApplyHeight = !shouldUseFullInputHeight && !isMultiline && !isMarkdownEnabled; | ||
|
|
||
| useFocusEffect( |
There was a problem hiding this comment.
I would highly appreciate if you can put a comment explaining why we added this effect and also link the original issue in the comment for easy reference to future folks wanting to understand the change
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
| // Height fix is needed only for Text single line inputs | ||
| const shouldApplyHeight = !shouldUseFullInputHeight && !isMultiline && !isMarkdownEnabled; | ||
|
|
||
| /** Focuses the text input when the component mounts, with a delay to allow navigation/modal animations to complete. */ |
There was a problem hiding this comment.
@Krishna2323 please add the reason as to why we added this and not what it does, also please link up to the original issue for which we used the useFocusEffect
There was a problem hiding this comment.
with a delay to allow navigation/modal animations to complete
This already defines why we need this, I have added the issue reference. If you still think something is missing, please tell me and I'll update.
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
| // Height fix is needed only for Text single line inputs | ||
| const shouldApplyHeight = !shouldUseFullInputHeight && !isMultiline && !isMarkdownEnabled; | ||
|
|
||
| /** Focuses the text input when the component mounts, with a delay to allow navigation/modal animations to complete. */ |
There was a problem hiding this comment.
| /** Focuses the text input when the component mounts, with a delay to allow navigation/modal animations to complete. */ | |
| /** We added a delay to focus on text input to allow navigation/modal animations to get completed, see issue https://github.com/Expensify/App/issues/64968 for more details */ |
There was a problem hiding this comment.
comment updated.
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
| // Height fix is needed only for Text single line inputs | ||
| const shouldApplyHeight = !shouldUseFullInputHeight && !isMultiline && !isMarkdownEnabled; | ||
|
|
||
| useFocusEffect( |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@amyevans issue link updated. |
|
✋ 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/amyevans in version: 9.1.91-0 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.1.92-5 🚀
|
Explanation of Change
Fixed Issues
$ #65855
PROPOSAL: #65855 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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_native.mp4
Android: mWeb Chrome
android_chrome.mp4
iOS: Native
ios_native.mp4
iOS: mWeb Safari
ios_safari.mp4
MacOS: Chrome / Safari
web_chrome.mp4
MacOS: Desktop
desktop_app.mp4