Open IuliiaHerets opened 5 days ago
Triggered auto assignment to @srikarparsi (DeployBlockerCash
), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.
Triggered auto assignment to @sakluger (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
💬 A slack conversation has been started in #expensify-open-source
:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Edited by proposal-police: This proposal was edited at 2024-10-17 18:17:16 UTC.
Search - Keyboard does not auto open in Search modal
keyboard doesnt open up because we dont use the useAutoFocusInput
inside the SearchRouterInput
component like we do in other textInput fields and the autoFocus
doesn't work well on android with modals
we should assign the ref to the inputCallbackRef
value of the useAutoFocusInput
hook:
const {inputCallbackRef } = useAutoFocusInput();
then use it in the TextInput
here:
ref={inputCallbackRef}
then we could remove the autoFocus as its now handled by the useAutoFocusInput
optionally we can delay the focus so that the input field focuses correctly by adding shouldDelayFocus
cc @289Adam289 @Kicu @SzymczakJ @luacmartins
Was this tested on a physical phone? Cos I'm testing this on android emulator right now (Pixel) and the keyboard does open:
https://github.com/user-attachments/assets/03b9bf9f-7cee-4dda-9ade-0f47feebc592
https://github.com/user-attachments/assets/8cb2c6b5-2ce6-4ff7-be97-44cab7d15de0
I did however noticed exactly one case where it didn't open, but I cannot reproduce it consistently. All the other cases it did open. I can test on a physical device later, but I'm curious if other people can reproduce this easily?
I can reliably reproduce this on a Pixel 6 physical device
I'm also able to pretty reliably reproduce this on an emulator (I'm using Pixel 7 Pro API 33):
https://github.com/user-attachments/assets/78ab4279-40fa-4600-8f3f-6b55cf73b126
@Kicu I'm able to reproduce on android emulator
https://github.com/user-attachments/assets/19de4748-6838-49f7-86b4-ad223ad19d96
Going to make this external
Job added to Upwork: https://www.upwork.com/jobs/~021846960678624915682
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jayeshmangwani (External
)
@rayane-djouah i am still not able to reproduce... is there a specific step that i am missing?
📣 @hayes102! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Keyboard does not auto open in Search modal
This issue of react-native-modal
We should update follow this comment
//.src/components/Search/SearchRouter/SearchRouterInput.tsx#L87
+ useEffect(() => {
+ InteractionManager.runAfterInteractions(() => {
+ inputRef.current?.blur();
+ inputRef.current?.focus();
+ });
+ }, []);
Edited by proposal-police: This proposal was edited at 2024-10-17 18:18:14 UTC.
Android - Search - Keyboard does not auto open in Search modal
If the TextInput
component is inside a some kind of view that renders asynchronously or after some delay, the keyboard may not open automatically. We already encounter such issues in other places . For example this one
Add below code in SearchRouterInput
component
const inputRef = useRef<BaseTextInputRef | null>(null);
useEffect(() => {
if(autoFocus){
InteractionManager.runAfterInteractions(()=>{
inputRef.current?.focus();
})
}
}, [])
ref={inputRef}
on TextInput component
added an alternative proposal
Note for C+: It looks like the other proposal also uses the shouldDelayFocus
prop in TextInput to execute code similar to my example and changed after my proposal.
https://github.com/Expensify/App/blob/0e388222c8425caa13cc0f88e1317edcc755ea0f/src/components/TextInput/BaseTextInput/index.tsx#L108-L121
Both useAutoFocusInput
and shouldDelayFocus
work, but IMO we should go with useAutoFocusInput
, as it's used across all auto-focused InputWrapper components.
@srikarparsi @luacmartins I'm attaching a video below to confirm how the input behaves after these changes. For example, if the keyboard is open on the report screen and we press 'Search' the following should happen:
https://github.com/user-attachments/assets/781091ac-014c-4e91-906c-768d0dadb727
@jayeshmangwani , I tried using useAutoFocusInput
during my debugging, but my emulator wasn’t working, so I didn't use it and found a new solution. Just a note for you. 😄
I tried using
useAutoFocusInput
during my debugging, but my emulator wasn’t working, so I didn't use it and found a new solution. Just a note for you. 😄
remove autoFocus and it will work 😄
I'm attaching a video below to confirm how the input behaves after these changes. For example, if the keyboard is open on the report screen and we press 'Search' the following should happen:
Yes, this looks correct to me
It looks like @abzokhattab’s proposal does this, @jayeshmangwani have you had a chance to verify this
Yes, this looks correct to me
Great! We can go with @abzokhattab 's Proposal of using useAutoFocusInput
🎀 👀 🎀 C+ reviewed
Current assignee @srikarparsi is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.
📣 @abzokhattab 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!
Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻 Keep in mind: Code of Conduct | Contributing 📖
Awesome, @abzokhattab do you think you’ll be able to put up a PR soon?
Thank you. the PR will be ready in the morning.
have you had a chance to verify this
Yes I've tested, and it works fine
Thank you. the PR will be ready in the morning.
Sorry, will that be in around an hour or a little longer. Since this is a deploy blocker, it’s a little more time sensitive.
I see i thought its a normal issue. then i will work on it now
Awesome, thank you!
@abzokhattab I noticed you're actively engaged with this issue and have updated a proposal just few minuted ago. Could you focus on this Deploy Blocker instead of introducing new proposals on other Issue?
@abzokhattab I noticed you're actively engaged with https://github.com/Expensify/App/issues/51050and have updated a proposal just few minuted ago. Could you focus on this Deploy Blocker instead of introducing new proposals on other Issue?
not actively engaged with this issue!! i am working on the current bug and that comment was pushed while the IOS is building
The pr will be ready in a few mins.
Thanks.
There we go https://github.com/Expensify/App/pull/51064 🎉 Thanks for your patience
Thanks, I am starting testing
@luacmartins @srikarparsi please remove the deploy blocker label and check this off whenever we confirm the fix worked.
Reviewing
label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.50-8 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-10-25. :confetti_ball:
For reference, here are some details about the assignees on this issue:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.51-4 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-10-29. :confetti_ball:
For reference, here are some details about the assignees on this issue:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.50-0 Reproducible in staging?: Y Reproducible in production?: N/A - new feature, doesn't exist in prod Email or phone of affected tester (no customers): applausetester+kh081006@applause.expensifail.com Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
Keyboard will auto open.
Actual Result:
Keyboard does not auto open.
Workaround:
Unknown
Platforms:
Screenshots/Videos
https://github.com/user-attachments/assets/01e1dcce-315f-496d-9d31-2b69b83b354b
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @sakluger