refined-github: Escape key canceling comments is conflicting with closing the emoji menu
I’m talking about this code : https://github.com/sindresorhus/refined-github/blob/master/source/features/add-keyboard-shortcuts-to-comment-fields.js#L42-L50
The problem is that when you type a : after a , GitHub opens the emoji menus, and the most obvious way to close it is with the esc key, but the esc key will close the comment. In some cases (but not all), you get a confirmation window, so you actually don’t lose what you’ve typed. In some cases you don’t. This makes this feature actually really painful.
This problem happens a lot when you write comments using languages that require a before :, like French.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 16 (5 by maintainers)
The problem is not not that you get or don’t get the confirmation modal, but that the esc key should close the emoji/people selector menu, not try to close the comment.
If I find a case where the confirmation screen is not asked, I’ll add info, but for me, the main part is that “esc” should just close the menu.
I just hit this issue. Wrote some internal review on a PR and lost everything because I tried to close this emoji view. Started to rewrite everything, almost finished it and again… this time I wanted to write an @ but this brought up the mentioning menu… and I automatically pressed escape and lost everything again. Sadly I’ve disabled the extension and won’t enable again until this is fixed. This issue costed me around 45 minutes today… and a lot of frustration.
In the esc handler there’s a line specifically to avoid this,
select.exists. Probably the selector needs to be updated.Edit: I was confusing it with the tab handler. The line is there, I needs to be copied for ESC as well.