-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[HOLD for payment 2024-12-16] [$250] The Composer isn't getting focus again after the attachment modal is dismissed #52898
Comments
Triggered auto assignment to @VictoriaExpensify ( |
Discovered this bug while reviewing this PR by @DylanDylann |
@VictoriaExpensify Could I take over this issue if this is external? because of more context here |
@VictoriaExpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Thanks for the context @DylanDylann - It's all yours |
Job added to Upwork: https://www.upwork.com/jobs/~021861194329606469814 |
Current assignee @DylanDylann is eligible for the External assigner, not assigning anyone new. |
Not overdue |
Edited by proposal-police: This proposal was edited at 2024-11-26 15:27:38 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.The Composer isn't getting focus again after the attachment modal is dismissed What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?
We should pass
What alternative solutions did you explore? (Optional) |
@FitseTLT Please detail your alternative solution. Note that we only apply this fix for the large screen Additionally, you missed the second bug: The main composer focus again after turn off RHP strict create expense but not in other RHP |
I don't think setTimeout is recommended in our codebase |
@DylanDylann what about runAfterInteraction? |
@DylanDylann Let me explain it a bit for you:
which will dispatch the focus when the open modal has been dismissed App/src/components/Modal/BaseModal.tsx Lines 151 to 153 in 70461d0
The problem is RHP are not like our modals and it is opened by navigation and the modal value will be set to false when the current screen/RHP is blurred here App/src/libs/Navigation/AppNavigator/AuthScreens.tsx Lines 214 to 215 in 70461d0
that will trigger the effect to focus the composer here App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx Lines 646 to 654 in 70461d0
But the onBlur is called too early immediately when the navigation away from the RHP starts even before the animation to close the RHP is finished so if there is a text input in the RHP our focus function will not focus the composer. Therefore for a similar solution we used as isReadyToFocus one we should set some file-level variable on blur of the screen like didRHPDismissed and hereApp/src/libs/ComposerFocusManager.ts Lines 215 to 216 in 70461d0
instead immediately resolving when there is no promise when the didRHPDismissed is true we will resolve it after some delay as CONST.ANIMATED_TRANSITION because the modal is correctly dismissed by that time. WDYT
|
@FitseTLT's #52898 (comment) looks good to me After testing I see setTimeout gives a better output than runAfterInteraction. However, runAfterInteraction can be a safer option because we need to avoid using setTimeout as much as possible in our App. Note in the PR phase: We need to make sure this change doesn't affect the current behavior on mobile web, app 🎀 👀 🎀 C+ Reviewed |
Triggered auto assignment to @grgia, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
📣 @DylanDylann 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @FitseTLT 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
Assigned! |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.72-1 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 2024-12-16. 🎊 For reference, here are some details about the assignees on this issue:
|
@DylanDylann @VictoriaExpensify @DylanDylann 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] |
Payment Summary: |
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.0.65-1
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @DylanDylann
Slack conversation (hyperlinked to channel name): ts_external_expensify_bugs
Action Performed:
Expected Result:
The Composer should be focused again
Actual Result:
The Composer isn't getting focus again
The same issue also happens when turning off task creation RHP
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug-focus-modal.mov
Bug-focus-RHP.mov
Recording.773.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @Issue Owner
Current Issue Owner: @VictoriaExpensifyThe text was updated successfully, but these errors were encountered: