microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.27k stars 29.31k forks source link

Input randomly doesn't work in quick pick and editors #228232

Closed Tyriar closed 1 week ago

Tyriar commented 2 months ago

This has happened once yesterday and once today for me. I open any quick pick (quick search, command palette), type and nothing happens.

In console I see:

Image

The same happens when typing into the editor.

I can't get much more information unfortunately since input is very broken. Reloading the window does fix it. I'm guessing it's related to editcontext, even though that setting is disabled.

aiday-mar commented 2 months ago

Concerning the control+home, control+end issue, when I enable trace level logging, I see the following too in the dev tools:

TRACE KeybindingService#dispatch ⌘↑ [ No matching keybinding ]

Not sure if this is somehow related to the edit context, I will investigate

aiday-mar commented 2 months ago

Initial investigation when the setting is disabled shows that the context key textInputFocus is not updated after the hidden div receives focus. Since the context key value is false, the context keys are evaluated as false and the command is not run. Have to investigate more.

aiday-mar commented 2 months ago

So after some investigation I have figured out why the input does not work when the setting is enabled. It has to do with the textInputFocus context key not being updated correctly.

You mention you saw this happen when the setting is disabled. Do you recall if after you disabled the setting you reloaded the window before seeing this issue? Perhaps it could be the hot reload I added does not work correctly and you were essentially seeing the same error as when the setting is enabled.

aiday-mar commented 2 months ago

I will keep an eye out for this issue and check if this happens when the setting is disabled.

This could also be related to the issue https://github.com/microsoft/vscode/issues/228104#event-14200294148. I will investigate it, it appears to once again be related to incorrect updating of context keys and therefore no forwarding of keys and input.

aiday-mar commented 2 months ago

I have merged two PRs that tackle focusing issues with the edit context:

https://github.com/microsoft/vscode/pull/228348 https://github.com/microsoft/vscode/pull/228325

I suspect the issue you saw is related to incorrect focusing too. Since I was not able to reproduce the issue without the setting enabled, let me know if you still see this happening starting from tomorrow's Insiders.

aiday-mar commented 1 week ago

This will be closed as this issue is no longer seen