gitmoji-vscode
gitmoji-vscode copied to clipboard
Selecting an emoji doesn't put focus on the right input field
As said in the title, after selecting a Gitmoji, the field of the first project is always focused on, regardless of which button was pressed. Would be nice if the cursor was put in the right commit message input box. https://user-images.githubusercontent.com/43749899/103943300-2079cd00-5132-11eb-9e59-bcfbcb4d8682.mp4
Hi @YeapGuy , thanks for your feedback, i have reproduced the problem and am looking for a solution.
Hello, any news on this ? Thanks
For me, the focus is not returned to the input at all, but to the "sync" button. Could that be fixed too, please?
:bump:
Actually, I refined this a bit. I wonder if it might actually be a VSCode bug. When I'm in the field and use a command to open gitmoji (so as not to use the mouse) then when the gitmoji is selected my focus is not returned to the input. However when I open gitmoji via command whilst the focus is on the editor window, then focus IS set to the commit message input. Very strange.
Is this something you can do something about, or is this VSCode? I'm not overly familiar with extension authoring.
There seem to be two independent problems:
- The focus doesn't go back to the "Source Control" view after the gitmoji inserts the emoji. This could be a gitmoji-vscode issue.
- VS Code seems to be confused about which input control inside the "Source Control" view should have focus when focus comes back to the view (from an editor). This could be a VS code issue.
For the second problem, whether the focus returns to the input field or not seems to depend on your history of focus within the "Source Control" view. In other words:
- If you invoke the command "Source Control: Focus on Source Control View" and there is nothing focused there yet, then the focus by default will go inside the input box (which is good). If you start typing in the commit message box, invoke the gitmoji command, the focus still doesn't come back to the input field (problem 1). But at least, then if you invoke "View: Show Source Control", focus goes back into directly into that commit message field (so no problem 2).
- However, if at some point, you clicked on a file inside the "Source Control" view (e.g., to check for changes), and then focus the commit message field, VS code will incorrectly remember that the focus should be on the file and not the commit message field. Then when you invoke the gitmoji command and invoke "View: Show Source Control", focus goes back to the file inside "Source Control" view instead of the commit message input field (problem 2). I assume this applies to the "Sync button" just as well as a file inside the "Source Control" view: it makes VS Code want to return focus there instead of the commit message input field default, even if the commit message input field had the focus most recently.