-
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-03-20] [$500] Chat - Two Modals Open Simultaneously During Text Editing #36381
Comments
Job added to Upwork: https://www.upwork.com/jobs/~01cf48132d330e8d95 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hoangzinh ( |
Triggered auto assignment to @CortneyOfstad ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Two Modals Open Simultaneously During Text Editing What is the root cause of that problem?missing action to hide the opened modals before calling the showDeleteModal() Within the function ReportActionItemMessageEdit at: 318
What changes do you think we should make in order to solve the problem?add the missing call the hideContextMenu() to hide all the active menus before performing showDeleteModal() as follow:
Results: MacOS: Chrome / Safari tests: 0213.movMacOS: Desktop tests: 0213.1.movWhat alternative solutions did you explore? (Optional)N/A |
📣 @LouzirMohamedAziz! 📣
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
Proposal[Updated] #36381 (comment) |
ProposalPlease re-state the problem that we are trying to solve in this issue.We show two open popovers in this experience What is the root cause of that problem?We are not unfocusing the composer when clicking the Context Menu three dots item. So composer keeps focus, and listens to the keyboard events. What changes do you think we should make in order to solve the problem?I reviewed what we do when we add an attachment. On that button press we explicitly blur the Composer.
if we call: ReportActionComposeFocusManager?.composerRef?.current?.blur(); We will take the focus away from the composer. And now the keyboard events will work on the popover menu items. What alternative solutions did you explore? (Optional)UPDATES: After amazing collaboration with @hoangzinh and insights from @aimane-chnaif As per #36381 (comment) and #36381 (comment) We should: Additional RCA from #36381 (comment) This RCA helps identify that we shouldn't force calling a blur, but rather alter the existing logic to let the event listeners only propagate for certain actions. |
ProposalPlease re-state the problem that we are trying to solve in this issue. Two modals open simultaneously, and the first one does not close upon pressing Enter. What is the root cause of that problem? Action is missing to hide the opened modals before calling the Delete Modal What changes do you think we should make in order to solve the problem? App/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.tsx Lines 271 to 280 in 0593b45
Need to add setIsPopoverVisible(false); **What alternative solutions did you explore? (Optional) modal.webm |
@hoangzinh any thoughts on the proposals above? Thanks! |
@CortneyOfstad I'm checking the expected behavior here. At the moment, when we tap on the three-dot menu here, the composer is still focused. It makes the keyboard navigation in the three-dot menu is not working as well. Screen.Recording.2024-02-15.at.08.40.06.movI think the composer should be unfocused when we tap on the three-dot menu. Like we tap in the three-dot menu of the header. What do you think? Screen.Recording.2024-02-15.at.08.44.18.mov |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Waiting for @CortneyOfstad thoughts here #36381 (comment) |
Sorry, was OoO yesterday! Reviewing now! |
@hoangzinh so I have been diving into this, and we don't unfocus the field when we click on anything else, but we do remove the cursor in other instances like clicking the emoji option as below: Do you feel that is a reasonable alternative? I feel that this is more in-line with other aspects of new.expensify, but interested to hear your thoughts! |
I think if there is a popup modal appears it should unfocus the main composer. For example: when a user taps on:
So in this case, if the user taps on the 3 dot menu to open a popup modal, I think we should unfocus the main composer. |
@hoangzinh I disagree, as we do not unfocus anything at this time. Other apps do not do this functionality, so I feel as though having it unfocus for the sake of unfocusing isn't worth the time. However, if you feel strongly about this, I do recommend bringing it to the team to discuss as we can dive in further! |
Sure @CortneyOfstad
btw could you elaborate on this one? I'm unsure if I understand your point. Thanks. |
@hoangzinh No worries! I should have explained this a bit better. My reasoning for not unfocusing is that we do not do this with other aspects currently, so essentially having to change all of those actions to unfocus to make this situation work seems like not a high priority. I would rather we adjust this situation to match the others (not unfocusing, but rather just removing the cursor in the text field). However, if you feel strongly that we should change the other aspects (emoji selection, etc) then I do recommend posting in #open-source for the team to discuss as a whole. |
sure @CortneyOfstad, but before I do that, I would like to understand your opinion first.
I'm confusing this one. Doesn't
Nope, I don't. I would like to reparaphrase my thoughts here. I suggest we only change the behavior of the three-dot item in the context menu Current: If the text field is focusing, when we tap on Screen.Recording.2024-02-24.at.11.43.01.movSuggest: we should unfocus (or remove the cursor) in the text field when we tap on |
Melvin, the proper solution is still in discussion |
Will give an update later, had a couple minutes for initial thoughts but want to spend more time after my office work. quick thoughts are that shouldPreventDefault prop is also a pattern used in places: https://github.com/search?q=repo%3AExpensify%2FApp+shouldPreventDefault&type=code When reviewing which is better I want to look at the usage of the https://github.com/Expensify/App/blob/3e74ddf0d2b408faa270ff243cf333065b177a87/src/components/BaseMiniContextMenuItem.tsx#L49C13-L49C38 and if it makes sense to pass in IDs, and can be done so from the actual menu actions, cause otherwise it's a bit of a detached code that might be hard to trace. |
Agreed. Can you update your current proposal with your approach using additional props? Then go ahead with PR. cc @bondydaa |
Thank you @hoangzinh for this collaboration, and helping getting a deeper understanding of the problem with your guidance. updated proposal |
thanks for getting all that resolved, I had thought we might do that on the PR sorry, that's why I'd assigned before. @jeremy-croff you're still going to spin up a PR right? |
@bondydaa Yes, thank you! |
@jeremy-croff any update on the PR? Thanks! |
It's merged! 😄 |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.51-3 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-03-20. 🎊 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:
|
@hoangzinh can you complete the checklist by EOD? Thanks! |
Payment Summary
|
BugZero Checklist:
|
Thanks @hoangzinh! |
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.40-0
Reproducible in staging?: y
Reproducible in production?: y
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: Applause - Internal Team
Slack conversation:
Action Performed:
1, Go to the conversation.
2, Write a message.
3, Hover over the message, click "more," modal opens.
4, Press the up arrow key, enabling editing.
5, Clear all text and press Enter.
6, Notice two modals open; the first should close before the second, as when clicking "save."
Expected Result:
Upon pressing Enter, the first opened modal should close.
Actual Result:
Two models open simultaneously, and the first one does not close upon pressing Enter.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6377306_1707774067269.Screen_Recording_2024-02-12_at_11.58.05_AM.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: