Skip to content
Bug reportAug 21, 2026· 0:28· 15 views

Monaco Editor v0.55.1: typing over a backward selection requires two keypresses on the textarea input path

0:28 total

Comments · 0

Be the first to comment.

Bug report— by SceneRecap AI

mediumeditor/browser/controller/textAreaHandler
os: macOSbrowser: Chromiumviewport: 1280x720monaco_version: 0.55.1

Repro steps

  1. 1.Configure Monaco editor options with editContext set to false (textarea fallback mode) and load 'const U = 19.05;' into the editor.
  2. 2.Click the 'Run playground' button to load the configured Monaco instance into the Preview pane.
  3. 3.Click into the Monaco result editor to focus at the end of the line.
  4. 4.Press Shift+Left to create a backward text selection over the trailing semicolon.
  5. 5.Type a character (such as 'a') over the backward selection.

Expected

The selected character should immediately be replaced on the first keypress.

Actual

On the textarea input path (editContext: false), typing over a backward selection does not replace the text cleanly on the first keystroke, requiring extra input.

Evidence

visualMonaco editor instance created with 'editContext: false' in the preview pane at 7.0s.
visualBackward selection active across semicolon at line 1 in the result editor at 13.0s.
visualCharacter 'a' replaces ';' only after subsequent key handling at 19.0s.
Issue markdown (copy-paste ready)
### Summary
When Monaco Editor is configured with `editContext: false` (fallback `textarea` input path), typing a character over a backward selection (created via `Shift+Left`) fails to process as expected on the first keypress.

### Steps to Reproduce
1. Set `editContext: false` in Monaco editor configuration (`t = 0.0s`).
2. Click the **Run playground** button to instantiate the editor (`t = 5.6s`).
3. Click into the result editor line (`t = 10.9s`).
4. Select backwards using `Shift+Left` (`t = 11.6s`).
5. Type a replacement character (`t = 17.0s`).

### Expected Result
The backward-selected character should immediately be replaced by the typed character on the first keypress.

### Actual Result
Typing over a backward selection on the textarea fallback path requires multiple keypresses or drops the initial keystroke.

*Recorded with SceneRecap.*

Your recordings could explain themselves too.

Free plan · silent recordings welcome · bug reports included.

Try SceneRecap free
Monaco Editor v0.55.1: typing over a backward selection requires two keypresses on the textarea input path · SceneRecap