-
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
Right Click Popover -> Edit Comment does not focus on the Edit Comment Textbox #3017
Comments
Triggered auto assignment to @Julesssss ( |
There are multiple factors stealing the focus away from the input box.
Context Menu itselfI didn't find any strong reason why it is stealing the focus but It is. If I remove all the manual focus logic from the code still focus is set back to the page To fix this so far, I think the best would be to just use a ComposerComposer is meant to take focus when any modal is closed as per, what could I say more I wrote this logic earlier. Now to fix this, we have many ways and we have to find the best.
|
Sorry @kevinksullivan, but I need to reassign |
Triggered auto assignment to @deetergp ( |
ProposalPlease refer to this comment #3017 (comment). |
@parasharrajat Apologies for not seeing this sooner. Your proposals for the Context Menu sound good, and as far as the options for Composer, if the "simple with no side effects" option works, then that is always the option I will choose! |
@kevinksullivan Am I good to start the PR? |
@kevinksullivan FYI an emoji reaction won't trigger a notification, so it's better to confirm as a comment |
Question:
|
It would be a regression if your fix for this issue causes the other behavior to break. We need a solution that works for the "Edit" selection sending focus to the Edit textbox, without preventing the others from sending focus back to the main composer textbox when performed. |
Ok. But before delving into that I would like to ask that whether we need that behaviour "Focus the composer on Context menu Close" at all. cc: @roryabraham @shawnborton . |
Yeah, I think we want to keep that behavior. It would also be great if the composer is refocused whenever the edit is made or cancelled:
That's additional scope though, so could be handled in a follow-up. |
We focus on the composer when the menu(which is a modal internally) is closed. But currently, there is no way to tell that a user-initiated So Onyx's way to do this would be to set a key and then reset it automatically which will cause an event like a trigger via onyx. And we can subscribe to that key in the composer. But This is not the correct way, I would say. I feel like we can remove the modal visibility-based autofocus from 'componentDidUpdate' on the Composer and call this method to requestFocus. I think technique two would be useful when we want to set focus on the close of the Edit box. Also, it will work for multiple Edit boxes. I don't see any drawback from this approach. Any thoughts @roryabraham? |
I definitely agree we don't want to put this data (whether the main
All that said, I don't understand your use of |
Thanks for the input. I have migrated from the use of SetTimeout in the PR. My actual solution does not need settimeout now We needed it so that we can wait for the context modal to close. But in PR, I delayed the calling of editComment so now we don't need settimeout. I am trying to get away from settimeout as much as possible. |
Issue resolved but I'm still waiting for the Offer to be sent. 🙄 |
Offer sent. |
Paid un upwork! |
Coming from https://github.com/Expensify/Expensify/issues/163577
Problem
If you right-click in the chat app to edit a comment, the edit comment textbox does not automatically get focused:
However this does not happen if you use the hover menu:
Reproducible Steps
• Sign in to the e.chat staging web app
• Right-click text and choose Edit Comment
• Textbox does not automatically get focused
Why is this important?
The two flows should be consistent.
Solution
TBD
Upwork post - https://www.upwork.com/jobs/~015ee115217a359f1b
The text was updated successfully, but these errors were encountered: