Microsoft/vscode

Some cursor movement events are ignored in webview

Open

#244.924 geöffnet am 27. März 2025

Auf GitHub ansehen
 (0 Kommentare) (7 Reaktionen) (1 zugewiesene Person)TypeScript (10.221 Forks)batch import
bughelp wantedwebview

Repository-Metriken

Stars
 (74.848 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 11h 43m) (1.000 gemergte PRs in 30 T)

Beschreibung

In VSCode webview extensions, keydown events are captured and preventDefault is called on them if they look like default keybindings that VSCode handles instead.

However, the logic to filter those events is a bit too simplistic. Specifically, on MacOS, ctrl+f is bound to "cursor right" and ctrl+p is bound to "cursor up" when in a text input, so isPrint and isFindEvent are incorrectly triggering when a text input is focused.

Does this issue occur when all extensions are disabled?: No (but the issue is with webviews in general)

  • VS Code Version: 1.98.2
  • OS Version: MacOS 15.3 (24D60)

Steps to Reproduce:

  1. Take any simple webview extension, such as this one, and add a <textarea> element
  2. Type something. Notice that ctrl+b moves the cursor to the left, but ctrl+f does not move the cursor to the right

Contributor Guide