Skip to content

Webviews can prevent keyboard shortcuts from working in quick picks #116897

@tspence

Description

@tspence
  • VS Code Version: 1.50
  • OS Version: Windows 10 && Mac OSX Catalina

Steps to Reproduce:

  1. Open a full-editor webview in the main editor area
  2. Open a text file in the editor
  3. Close the text file using a keyboard shortcut (Cmd+W or Ctrl+F4); the full-editor webview should now receive focus
  4. Press Cmd+P to open the quick-pick file selector
  5. Select a file from the quick pick editor; VS Code will jump you to that file
  6. While editing this file, press Cmd+P again to open the quick-pick file selector

Expected Results:

  • I can use keyboard shortcuts for Cut / Copy / Paste while in the quick pick editor

Actual Results:

  • All keyboard shortcuts are disabled in this quick pick window.

Root Cause:
During step 5 of the reproduction, VS Code switches focus to the code file you selected from the quick pick. Additionally, a delayed action fires as the quick pick closes. The delayed action tells the system to return focus to the element that previously had focus, which was the full-editor webview.

The full-editor webview thinks it has focus, and as a result it absorbs all cut/copy/paste commands that are defined in webview.contribution.ts.

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

Metadata

Metadata

Assignees

Labels

author-verification-requestedIssues potentially verifiable by issue authorbugIssue identified by VS Code Team member as probable bugwebviewWebview issues

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions