question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When opening and closing the context menu, focus position is sometimes lost.

See original GitHub issue

Issue Type: Bug

  1. Open a folder as a workspace.
  2. Press CMD+Shift+E or CTRL+Shift+E to focus on explorer and choose a file.
  3. Press your context menu key.
  4. Arrow through the menu, then decide you don’t want to select an item, and press Escape.

Result: In some cases, focus position is lost, and keyboard focus is not on the file you were on before.

This worked in 1.53.

Will attach a screeencast.

VS Code version: Code - Insiders 1.54.0-insider (3290f9a73ba6fc3b1063ea32476067434ee91b1d, 2021-02-26T05:25:57.426Z) OS version: Darwin arm64 20.4.0

System Info
Item Value
CPUs undefined
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 2
Memory (System) 16.00GB (0.18GB free)
Process Argv –crash-reporter-id 4ea43554-4a6d-4f7c-b2fb-6de1a3610d98
Screen Reader yes
VM 0%
Extensions (37)
Extension Author (truncated) Version
npm-intellisense chr 1.3.1
gitignore cod 0.6.0
doxdocgen csc 1.1.0
dart-code Dar 3.19.2
flutter Dar 3.19.0
vscode-markdownlint Dav 0.39.0
vscode-eslint dba 2.1.14
gitlens eam 11.2.1
EditorConfig Edi 0.16.4
vscode-npm-script eg2 0.3.16
prettier-vscode esb 5.9.2
vscode-pull-request-github Git 0.23.1
beautify Hoo 1.5.0
better-cpp-syntax jef 1.15.5
jstl jsx 1.0.4
flutter-intl loc 1.13.0
vscode-docker ms- 1.10.0
vscode-edge-devtools ms- 1.1.3
python ms- 2021.2.582707922
vscode-pylance ms- 2021.2.4
jupyter ms- 2021.3.593162453
remote-containers ms- 0.161.0
remote-ssh ms- 0.64.0
remote-ssh-edit ms- 0.64.0
remote-wsl ms- 0.54.0
cmake-tools ms- 1.6.0
cpptools ms- 1.2.2
cpptools-extension-pack ms- 1.0.0
vscode-github-issue-notebooks ms- 0.0.68
vscode-markdown-notebook ms- 0.0.14
vsliveshare ms- 1.0.3784
vsliveshare-audio ms- 0.1.91
debugger-for-edge msj 1.0.15
indent-report ogo 1.0.0
nunjucks ron 0.3.0
cmake twx 0.0.17
vscode-webhint web 1.5.11

(1 theme extensions excluded)

A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368:30146709
vsreu685:30147344
python383:30185418
pythonvspyt602:30263608
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstry244:30244315
pythonvsdeb440:30224570
pythonvsded773:30223139
pythonvspyt875:30259475
pythontb:30258533
vscoresta800cf:30263255
vsc_aa:30263845

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
MarcoZehecommented, Feb 26, 2021

My screencast shows that as well. It seems to matter whether you walk down the menu using the arrow keys, possibly even wrap around to the top, before pressing Escape.

0reactions
joaomorenocommented, Feb 26, 2021

@deepak1556: @isidorn and I were able to repro this occasionally. It’s definitely hard to repro, but when it happens here’s what’s going on: the user presses <kbd>Escape</kbd> to close the context menu but <kbd>Escape</kbd> is still forwarded as a keyboard event to the DOM, effectively clearing the tree’s focus. So the <kbd>Escape</kbd> key event gets handled twice. Any thoughts?

Btw we can’t repro this when the context menu is opened via mouse, only via keyboard with the <kbd>Ctrl Shift Meta M</kbd> shortcut, having VoiceOver enabled.

@deepak1556 I added you since it seems like an Electron/macOS issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

WPF DataGrid loses focus on ContextMenu - Stack Overflow
The problem is, every time the ContextMenu is opened (either by right mouse button or menu key), the DataGrid loses its focus and...
Read more >
Context menus not closing when losing focus — oracle-tech
When the popup loses focus, if autoHide is true, then it is hidden. But losing focus is not the same as moving the...
Read more >
Context/drop-down menus no longer abort, "close" by clicking ...
My context/drop-down menus will no longer abort "close" as they used to with a simple off-menu click. The only way I can force...
Read more >
Is there a way to prevent the submenus from closing when ...
to recreate the issue, run the app, then expand out one of the submenus and then right mouse click an item. the context...
Read more >
Handling Events :: Eloquent JavaScript
When it loses focus, the element gets a "blur" event. Some events, like these two and "scroll" , do not propagate. A handler...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found