Skip to content

Cut/paste broken for CodeMirror editor in extension webview after updating VSCode #232692

@canislupaster

Description

@canislupaster

Type: Bug

  • Create an extension using a webview that mounts a CodeMirror editor.
  • Cut/paste doesn't work, though they do in version 1.94.
  • Paste events are not emitted for CodeMirror's contenteditable div.

Strangely enough, duplicating the div or making another contenteditable div works. CodeMirror seems mostly event driven, so I tried to receive paste events by deleting existing event handlers, but didn't get anywhere. I'm hoping someone knows what changed inside VSCode to treat this situation differently.

Here's a simple example extension based off the Cat Coding webview sample. Thank you for reading.

VS Code version: Code - Insiders 1.96.0-insider (ea6e8e2, 2024-10-30T23:45:51.779Z)
OS version: Darwin x64 23.6.0
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz (16 x 2300)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 10, 8, 6
Memory (System) 32.00GB (3.90GB free)
Process Argv
Screen Reader no
VM 0%
Extensions: none (except one being developed)
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
vsaa593cf:30376535
py29gd2263:31024238
c4g48928:30535728
vscrpc:30624061
962ge761:30841072
pythongtdpath:30726887
pythonnoceb:30776497
asynctok:30898717
dsvsc014:30777825
dsvsc015:30821418
pythonmypyd1:30859725
2e7ec940:31000449
pythontbext0:30879054
cppperfnew:30980852
pythonait:30973460
945dj816:31013170
dvdeprecation:31040973
dwnewjupyter:31046869
2f103344:31071589
legacy_priority:31057981
nativerepl1:31134653
refactort:31084545
pythonrstrctxt:31093868
wkspc-onlycs-t:31132770
nativeloc1:31118317
wkspc-ranged-t:31151552
cf971741:31144450
e80f6927:31120813
12bdf347:31141542
iacca1:31150324
notype1:31143044
dwcopilot:31158714
g7688163:31155431

Metadata

Metadata

Assignees

Labels

bugIssue 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