-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[$500] Android - IOU-Tapping hold request, cursor is shown but keypad is not opened #37279
Comments
Job added to Upwork: https://www.upwork.com/jobs/~012dbcf06cfb05e557 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ishpaul777 ( |
Triggered auto assignment to @johncschuster ( |
👋 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:
|
Triggered auto assignment to @rlinoz ( |
We think that this bug might be related to #vip-bills |
ProposalPlease re-state the problem that we are trying to solve in this issue.Tapping hold request, cursor is shown but keypad is not opened What is the root cause of that problem?We are focusing using the App/src/pages/iou/HoldReasonPage.tsx Line 89 in 668df99
What changes do you think we should make in order to solve the problem?instead of passing prop here we should use the const {inputCallbackRef} = useAutoFocusInput(); ref={inputCallbackRef} AlternativelyWe can use the CodeFollowing the logic in const focusTimeoutRef = useRef(null);
useFocusEffect(
useCallback(() => {
focusTimeoutRef.current = setTimeout(() => {
if (inputRef.current) {
inputRef.current.focus();
}
return () => {
if (!focusTimeoutRef.current) {
return;
}
clearTimeout(focusTimeoutRef.current);
};
}, CONST.ANIMATED_TRANSITION);
}, []),
); |
@neonbhai Can you point to offending PR ? |
I can reproduce this in production so this can be dealt as normal bug, no need to block deploy for this one 🙃 |
@izarutskaya can you please test again on production android app with the same android device where you reproduced bug on staging build? |
Record_2024-02-27-18-58-33.mp4 |
ProposalPlease re-state the problem that we are trying to solve in this issueWhen the HoldReasonPage opens, the input is looks like it's focused but the keyboard doesn't show up. What is the root cause of that problem?I was not able to find any offending PR within the deploy checklist, so I'm assuming this was not caused by the latest deploy. This being said, the root cause of why the keyboard does not open on Android even though the input looks like it's focused (we see focused styles and the cursor) is because the focus is called when the component is not completely ready, most likely because of the navigation transition. I can confirm this since in rare cases, the keyboard does show-up (randomly) and I think this varies due to individual device thread load. This is the logic that handles the autofocus on mount on native platforms, see code block. What changes do you think we should make in order to solve the problem?Within the native specific code block mentioned above we can observe that we already have logic implemented to delay the focusing on mount via So within the HoldReasonPage we should pass Since this alone would still not show the keyboard 100% of the time (depending on individual device thread load), I suggest wrapping the focus call from within the existing Changed code: if (shouldDelayFocus) {
const focusTimeout = setTimeout(() => {
InteractionManager.runAfterInteractions(() => input.current?.focus()); // <- this line
}, CONST.ANIMATED_TRANSITION);
return () => clearTimeout(focusTimeout);
} VideosAndroid: Native
|
Even if we cannot reproduce this in prod, since we still can get the keyboard to show up, because of this I will remove the deploy blocker label. |
Thanks for your proposals @ikevin127 @neonbhai, both of the given solutions works, @ikevin127 has better explaination for the root cause but i prefer the solution the given by @neonbhai becuase that is sort of what preferred in docs https://github.com/Expensify/App/blob/main/contributingGuides/STYLE.md#how-do-i-auto-focus-a-textinput-using-usefocuseffect, |
Current assignee @rlinoz is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new. |
@ishpaul777, this is a dupe of #36948 with some different issue but the solution is the same. I think we should hold here. |
yup, @Krishna2323 proposed first here |
@situchan if you dont mind can we move @Krishna2323 proposal here i assume you haven't started reviewing till now 🙇♂️ |
Ah sorry I just completed review. It was weekly and @Krishna2323 bumped me on slack so I already planned review today |
I understand why this was marked as deploy blocker. |
I agree that @neonbhai's solution goes by the docs, but in this case the TextInput What do you guys think ? |
@ikevin127 |
If you have better approach, please raise discussion on slack and get votes. |
@situchan I understand how While the issue can be fixed from the root and just use the Just my 2 cents ✌️ I'll comment on Slack and see what others think 🙏 Edit: |
I think we should hold this in favor of #36948 since the proposal was first posted there. Do you agree @situchan @ishpaul777 ? |
Production video -4947531272222306079no56788.mp4 |
Moving to weekly since it is on HOLD |
PR of the other issue is in draft. |
PR of the other issue is in draft. |
Other PR is deployed and fixed this one as expected, so closing. |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 1.4.44
Reproducible in staging?: Y
Reproducible in production?: N
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause-Internal Team
Action Performed:
Expected Result:
Tapping hold request, cursor is shown similarly keypad must be opened.
Actual Result:
Tapping hold request, cursor is shown but keypad is not opened.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Bug6393692_1709018301629.hold.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: