You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Escape key unfocuses the editor when not meant to. #37398
Describe the bug
When trying to exit the multi cursor function (Ctrl + D) with the escape key, the editor loses focus. before the update, it worked fine.
(happens also when trying to deselect a selected text, but can be deselected using the arrow keys instead)
To Reproduce
Steps to reproduce the behavior:
Select a word or a character.
Press Ctrl + D until you've selected the desired words that you wish to change
When trying to deselect with ESC, the editor loses focus.
Expected behavior
When a text is selected or the editor has multiple cursors, pressing ESC should only deselect or exit the multi cursor mode and not exit to navigation mode.
GIF
Desktop :
OS: Windows 10
Browser Chrome
Version 77.0.3865.120
Additional context
Based on bug #37146 and PR #37167
With the change in the functionality of navigating challenges using Esc, I believe this has come about. You can snap out of multi-cursor by clicking somewhere on the editor.
What can be done is that we use Ctrl + D to snap out of the mode as well.
What can be done is that we use Ctrl + D to snap out of the mode as well.
That could work too.
The ESC key is such a generic key that everyone uses it to cancel tasks, message and all kinds of stuff.
The change of the navigation key may cause confusion and discomfort when trying to deselect text or to hide the autocomplete pop-up window (maybe in more situations that I didn't think of).
Thanks for ruling those out. Seems like all the obvious ones are taken.
Overriding default behaviour can be frustrating, we'd want to consider that carefully. It may be better to go with a slightly obscure key combination that does not conflict with any browsers. CTRL + ~ seems safe, though. Another option is ALT + N, which is more intuitive, but has some (fairly minor) conflicts.
Edge: Alt + N | Move focus to notification or download (if available).
Firefox uses ALT on its own to show or hide the top menu, but ALT + N does nothing.
Closing this as stale. I think we will just have to live with this one for the time being. If anyone wants to continue the conversation, feel free to leave a message and we can reopen this. Thanks and happy coding 🎉
Activity
[-]Escape key unfocuses editor when not meant to.[/-][+]Escape key unfocuses the editor when not meant to.[/+]thecodingaviator commentedon Oct 19, 2019
With the change in the functionality of navigating challenges using
Esc, I believe this has come about. You can snap out of multi-cursor by clicking somewhere on the editor.What can be done is that we use
Ctrl + Dto snap out of the mode as well.I'll now defer to @raisedadead
DimaTc commentedon Oct 19, 2019
That could work too.
The
ESCkey is such a generic key that everyone uses it to cancel tasks, message and all kinds of stuff.The change of the navigation key may cause confusion and discomfort when trying to deselect text or to hide the autocomplete pop-up window (maybe in more situations that I didn't think of).
ojeytonwilliams commentedon Oct 19, 2019
Thanks for reporting this, looks like I should not have gone with
escape!How about
ctrl+escape? Does that conflict with anything you can think of? Edit: apparently that opens the start menu on Windows. Not that, then.DimaTc commentedon Oct 19, 2019
ESCis pretty heavily used...CTRL + ESCas you said opens the start menu.ALT + ESCsome kind ofALT + TABin windows (alsoCTRL + ALT + ESC)SHIFT + ESCis the chrome's task manager.CTRL + SHIFT + ESC- windows task manager.ALT + SHIFT + ESC- does something in windows, I don't know what but it changes focus.Mmm, Maybe
CTRL + N? N for navigation, and overriding the default behavior of the browser?Edit: apparently the browser should protect the
CTRL+Nbehavior... MaybeCTRL + ~?ojeytonwilliams commentedon Oct 19, 2019
Thanks for ruling those out. Seems like all the obvious ones are taken.
Overriding default behaviour can be frustrating, we'd want to consider that carefully. It may be better to go with a slightly obscure key combination that does not conflict with any browsers.
CTRL + ~seems safe, though. Another option isALT + N, which is more intuitive, but has some (fairly minor) conflicts.Firefox uses
ALTon its own to show or hide the top menu, butALT + Ndoes nothing.@raisedadead any thoughts?
vkWeb commentedon Oct 19, 2019
@ojeytonwilliams shift + n? Looks safe to me: https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts
ojeytonwilliams commentedon Oct 19, 2019
@vkWeb that's just uppercase 'N', so sadly not.
vkWeb commentedon Oct 19, 2019
@ojeytonwilliams Woaah, shit 🤣 I totally forgot that the editor is focused.
moT01 commentedon Sep 18, 2020
Closing this as stale. I think we will just have to live with this one for the time being. If anyone wants to continue the conversation, feel free to leave a message and we can reopen this. Thanks and happy coding 🎉