Hitting escape *twice* while typing a reply causes a browser freeze
Summary
Hitting Esc while typing a reply causes the browser to prompt Are you sure you want to cancel creating this comment?
. Hitting Esc again (to effectively click Cancel
on that prompt) puts the browser in a somewhat frozen state.
I frequently find myself doing this when the emoji picker erroneously opens after I type a colon, and I instinctively press Esc to close it. Perhaps actually allowing Esc to dismiss the emoji picker would be a welcome enhancement.
As someone who uses the keyboard much more than the mouse, this is a maddening bug.
Steps to reproduce
- Start typing a reply to a comment.
- Hit Esc.
- The browser will prompt
Are you sure you want to cancel creating this comment?
- The browser will prompt
- Hit Esc again (to effectively click
Cancel
on that prompt).- The browser prompt will be dismissed.
- The reply textbox will lose focus.
- Click in the reply textbox (or any other comment textbox).
- The cursor does not appear and you cannot type text. It's almost as if the textbox is "disabled".
- Switch to a different browser tab and then switch back.
- The textbox functionality is restored
Interestingly, in step 3 if I instead actually click Cancel
on the prompt, everything behaves as usual:
- The dialog is dismissed
- The textbox retains focus and is functional.
Even more interestingly, in step 5 (when it's in a bad state) if I hit Esc a third time (again bringing up the prompt), and clicking Cancel
, then that also "fixes" the problem and functionality is restored.
It's almost as if there are multiple handlers for Esc that are fighting.
What is the current bug behavior?
It freezes.
What is the expected correct behavior?
It shouldn't freeze.
Relevant logs and/or screenshots
I see nothing interesting in the F12 dev tools.
Output of checks
This bug happens on GitLab.com.
Version Information
- gitlab.com is currently running
GitLab Enterprise Edition 13.2.0-pre 766dad503f0
.- I've also observed this in gitlab-ce 12.10, and I think it was introduced around that version or perhaps 12.8 or 12.9
- Observed in:
- Chrome 83 on Linux
- Chrome 81 on Windows
- Does not occur in:
- Firefox 68.10.0esr on Linux