-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[Due for payment 2025-05-22] [$250] Android - RHP Field - Keyboard is not displayed when navigating back from Help Panel #59397
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
Comments
Triggered auto assignment to @johncschuster ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Keyboard is not displayed when navigating back from Help Panel What is the root cause of that problem?
not automatically update when navigating back from Help Panel What changes do you think we should make in order to solve the problem?We should add the useEffect here const {inputCallbackRef, inputRef} = useAutoFocusInput();
useEffect(() => {
if (inputRef.current) {
inputRef.current.focus();
}
}, []); to automatically update when the page reload What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?N/A What alternative solutions did you explore? (Optional)Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job. |
🚨 Edited by proposal-police: This proposal was edited at 2025-04-01 05:37:58 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
App/src/hooks/useAutoFocusInput.ts Lines 59 to 65 in 9ce4864
In this bug, the input is indeed being focused, but the on-screen keyboard does not appear because the modal animation transition is still in progress when the focus is triggered.
Line 81 in 9ce4864
This animation is intended to simulate the modal close animation, but the timing doesn’t match exactly. As a result, when we call Line 81 in 9ce4864
the actual modal animation might still be running.
Line 112 in 9ce4864
What changes do you think we should make in order to solve the problem?
App/src/hooks/useAutoFocusInput.ts Line 64 in 9ce4864
const prevShouldHideSidePane = usePrevious(shouldHideSidePane)
useEffect(() => {
if (!shouldHideSidePane || !prevShouldHideSidePane) {
return;
}
setTimeout(()=>{
setIsScreenTransitionEnded(isSidePaneTransitionEnded);
}, 150)
}, [isSidePaneTransitionEnded, shouldHideSidePane]);
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?N/A What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.The keyboard doesn't show after the sidepane modal closed. What is the root cause of that problem?The main root cause is that the focus is called too early before the modal is completely closed. We have a logic here in App/src/hooks/useAutoFocusInput.ts Lines 58 to 67 in f01c7de
We already call setIsSidePaneTransitionEnded(true) after the animation finishes, but that doesn't mean the modal is completely closed (btw the animation here is web only). Lines 68 to 83 in f01c7de
But that's not the real problem. The problem is in this useEffect. App/src/hooks/useAutoFocusInput.ts Lines 58 to 67 in f01c7de
However, What changes do you think we should make in order to solve the problem?We can create a context that we put in AuthScreens to hold the So, for our case, we can use
(No need to create a context, but lmk if we want one) What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?N/A |
@johncschuster Whoops! This issue is 2 days overdue. Let's get this updated quick! |
This comment has been minimized.
This comment has been minimized.
@johncschuster 6 days overdue. This is scarier than being forced to listen to Vogon poetry! |
Job added to Upwork: https://www.upwork.com/jobs/~021909740534838936622 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rayane-d ( |
@johncschuster @rayane-d this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks! |
@rayane-d Eep! 4 days overdue now. Issues have feelings too... |
Will review soon |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
ProposalPlease re-state the problem that we are trying to solve in this issue.Keyboard is not displayed when navigating back from Help Panel What is the root cause of that problem?We called input.focus() too early, before the Help panel page was dismissed, so the keyboard failed to appear. This issue has occurred frequently What changes do you think we should make in order to solve the problem?We don't know exactly when the keyboard is ready to appear, so I suggest that we re-focus the input to trigger the keyboard. This solution will fix and cover cases related to the timing of auto-focusing the input to show the keyboard. 1 Create new state App/src/hooks/useAutoFocusInput.ts Line 25 in c4122fb const [hasRequestedRefocus, setHasRequestedRefocus] = useState(false);
App/src/hooks/useAutoFocusInput.ts Line 26 in c4122fb
useEffect(() => {
if (!isScreenTransitionEnded || !isInputInitialized || !inputRef.current || splashScreenState !== CONST.BOOT_SPLASH_STATE.HIDDEN) {
return;
}
const focusTaskHandle = InteractionManager.runAfterInteractions(() => {
requestAnimationFrame(() => {
if (inputRef.current && isMultiline) {
moveSelectionToEnd(inputRef.current);
}
inputRef.current?.focus();
setIsScreenTransitionEnded(false);
setHasRequestedRefocus(true); // add this
});
});
return () => {
focusTaskHandle.cancel();
};
}, [isMultiline, isScreenTransitionEnded, isInputInitialized, splashScreenState]);
App/src/hooks/useAutoFocusInput.ts Line 42 in c4122fb const {keyboardHeight} = useKeyboardState();
useEffect(() => {
const shouldRefocus = !isScreenTransitionEnded && keyboardHeight === 0 && hasRequestedRefocus;
if (!shouldRefocus) {
return;
}
Keyboard.dismiss();
InteractionManager.runAfterInteractions(() => {
inputRef.current?.focus();
});
return () => {
setHasRequestedRefocus(false);
};
}, [keyboardHeight, isScreenTransitionEnded, hasRequestedRefocus]);
Screen.Recording.2025-04-15.at.23.12.56.movWhat specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?None What alternative solutions did you explore? (Optional)Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job. |
This comment has been minimized.
This comment has been minimized.
@rayane-d Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Thanks, everyone, for your proposals! Below is a side‑by‑side comparison of each idea:
@bernhardoj’s proposal looks good to me because it:
🎀👀🎀 C+ reviewed |
PR is ready cc: @rayane-d |
This issue has not been updated in over 15 days. @francoisl, @johncschuster, @bernhardoj, @rayane-d eroding to Monthly issue. P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do! |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.45-21 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2025-05-22. 🎊 For reference, here are some details about the assignees on this issue:
|
@rayane-d @johncschuster @rayane-d The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button] |
BugZero Checklist:
Bug classificationSource of bug:
Where bug was reported:
Who reported the bug:
Regression Test Proposal Template
Regression Test ProposalPrecondition:Test:Do we agree 👍 or 👎 |
Payment Summary (to be issued after regression window has passed)Contributor: @bernhardoj owed $250 via NewDot |
Requested in ND. |
BugZero Checklist:
Bug classificationSource of bug:
Where bug was reported:
Who reported the bug:
Regression Test ProposalPrecondition:
Test:
Do we agree 👍 or 👎 |
Payment Summary
BugZero Checklist (@johncschuster)
|
$250 approved for @bernhardoj |
Requested in ND |
$250 approved for @rayane-d |
Uh oh!
There was an error while loading. Please reload this page.
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: 9.1.21-0
Reproducible in staging?: Yes
Reproducible in production?: Unable to check, new feature
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: #59156
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Device used: Samsung Galaxy A12 / Android 13
App Component: User Settings
Action Performed:
Precondition : Help Panel is enabled
Expected Result:
The input field is focused, and on-screen keyboard is displayed, similar to mWeb behavior
Actual Result:
The input field is focused, but on-screen keyboard is not displayed, different from mWeb behavior
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6784750_1743110346795.Dvnb8264_1_.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @johncschusterThe text was updated successfully, but these errors were encountered: