Skip to content

Escape key unfocuses the editor when not meant to. #37398

Closed

Description

@DimaTc

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:

  1. Select a word or a character.
  2. Press Ctrl + D until you've selected the desired words that you wish to change
  3. 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
2019-10-19_17-39-18

Desktop :

  • OS: Windows 10
  • Browser Chrome
  • Version 77.0.3865.120

Additional context
Based on bug #37146 and PR #37167

Activity

  1. changed the title [-]Escape key unfocuses editor when not meant to.[/-] [+]Escape key unfocuses the editor when not meant to.[/+] on Oct 19, 2019
  2. thecodingaviator commented on Oct 19, 2019

    @thecodingaviator
    Contributor

    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.

    I'll now defer to @raisedadead

  3. added
    status: discussing
    on Oct 19, 2019
  4. DimaTc commented on Oct 19, 2019

    @DimaTc
    Author

    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).

  5. ojeytonwilliams commented on Oct 19, 2019

    @ojeytonwilliams
    Contributor

    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.

  6. DimaTc commented on Oct 19, 2019

    @DimaTc
    Author

    ESC is pretty heavily used...

    • CTRL + ESC as you said opens the start menu.

    • ALT + ESC some kind of ALT + TAB in windows (also CTRL + ALT + ESC)

    • SHIFT + ESC is 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+N behavior... Maybe CTRL + ~?

  7. ojeytonwilliams commented on Oct 19, 2019

    @ojeytonwilliams
    Contributor

    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.

    @raisedadead any thoughts?

  8. ojeytonwilliams commented on Oct 19, 2019

    @ojeytonwilliams
    Contributor

    @vkWeb that's just uppercase 'N', so sadly not.

  9. vkWeb commented on Oct 19, 2019

    @vkWeb
    Member

    @ojeytonwilliams Woaah, shit 🤣 I totally forgot that the editor is focused.

  10. moT01 commented on Sep 18, 2020

    @moT01
    Member

    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 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: discussing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions