Skip to content

Hitting Enter key during IME composition on the find widget should not be handled by VSCode #107154

Closed

Description

  • VSCode Version: 1.50.0-insider
  • OS Version: Darwin x64 18.7.0

Steps to Reproduce:

  1. Add the following keybinding:
    {
      "key": "enter",
      "command": "closeFindWidget",
      "when": "editorFocus && findWidgetVisible"
    }
  1. Open the find widget and input a text with IME, then hit Enter key to fix the IME input.
  2. The find widget is closed and the text is inserted to the editor. This is because, Enter key, which was intended to confirm IME input, was handled by VSCode and triggers closeFindWidget command configured above though it should not have been.

vscode-find-ime-example

Enter key is used by IME to confirm the input texts and should not be handled by VSCode during IME composition.
During text input in the editor areas, such IME handling can be done by extensions making use of compositionStart and compositionEnd events, like VSCodeVim does. However, it's impossible outside the editor areas like on the find widget.
VSCode should handle such IME composition on the find widget (and other native UIs).

Does this issue occur when all extensions are disabled?: Yes

Activity

  1. vscodebot commented on Sep 21, 2020

    @vscodebot

    (Experimental duplicate detection)
    Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

  2. whitphx commented on Sep 21, 2020

    @whitphx
    Author

    The suggested issue does not seem related

  3. added
    bug
    on Oct 8, 2020
  4. rebornix commented on Oct 12, 2020

    @rebornix
    Contributor

    Good point. Disallowing keybindings during composition makes most of the sense but I remember seeing issues complaining that some of the keyboard shortcuts not working in composition in some cases. Thus a new global context key isComposing will be added to give the choice to users.

  5. added
    unreleased
    insiders-released
    and removed
    unreleased
    on Oct 12, 2020
  6. isidorn commented on Oct 29, 2020

    @isidorn

    I can still reproduce this. Though I am maybe using a different composition widget on my macOS. I just hold the e key for example and this composition widget shows up. Pressing enter closes the find widget as the original issue outlined.

    Screenshot 2020-10-29 at 16 49 21

  7. 3 remaining items

  8. removed
    insiders-released
    on Oct 29, 2020
  9. whitphx commented on Oct 29, 2020

    @whitphx
    Author

    Thank you, I confirmed it too.

    In my case, I tested it with the keybinding that I have posted on the first comment and fixed to use isComposing like this:

        {
          "key": "enter",
          "command": "closeFindWidget",
          "when": "editorFocus && findWidgetVisible && !isComposing"
        }
    

    The problem still exists.

    I used the lasted insider version.

    Version: 1.51.0-insider
    Commit: 2ee8b8c645ec8ab54304bacae7aa979c1d9c647a
    Date: 2020-10-29T06:00:13.428Z
    Electron: 9.3.3
    Chrome: 83.0.4103.122
    Node.js: 12.14.1
    V8: 8.3.110.13-electron.0
    OS: Darwin x64 19.6.0
    

    However, interestingly, the keybinding below that is included in the defaults prevents closing the find widget during IME composition expectedly.

    {
      "key": "shift+escape",
      "command": "closeFindWidget",
      "when": "editorFocus && findWidgetVisible && !isComposing"
    }
    
  10. rebornix commented on Nov 11, 2020

    @rebornix
    Contributor

    @tuttieee may I ask what IME you are using? I tested with macOS Hiragana IME but it works

    iscomposing

    also Isidor Nikolic (@isidorn) the one you see is slightly different, it's macOS native accent picker (I don't really know the name) and when that quick pick shows up, the IME is not in composition mode, thus we can't really tell if the quick pick is visible or not. It's similar to the emoji quick pick which we don't support.

  11. added
    info-needed
    and removed
    verification-found
    on Nov 11, 2020
  12. isidorn commented on Nov 11, 2020

    @isidorn

    Peng Lyu (@rebornix) thanks for explaining. I was not aware it is a different thing...

  13. whitphx commented on Nov 11, 2020

    @whitphx
    Author

    Peng Lyu (@rebornix) I'm sorry, I found I tested it with another old keybinding that didn't care about isComposing and it was successful deleting the wrong keybinding.
    I confirmed it now works fine.
    Thank you for your support 😄

  14. added and removed
    info-needed
    on Nov 11, 2020
  15. locked and limited conversation to collaborators on Dec 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugeditor-findverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions