-
Notifications
You must be signed in to change notification settings - Fork 4k
Open
Description
Reproducible in vscode.dev or in VS Code Desktop?
- Not reproducible in vscode.dev or VS Code Desktop
Reproducible in the monaco editor playground?
- Not reproducible in the monaco editor playground
Monaco Editor Playground Link
Monaco Editor Playground Code
const value = /* set from `myEditor.getModel()`: */ `function hello() {
alert('Hello world!');
}`;
const myEditor = monaco.editor.create(document.getElementById("container"), {
value,
language: "javascript",
automaticLayout: true,
editContext: false // this causes the bug
});Reproduction Steps
- Set
editContext: falsein editor config - Select text in editor from right to left
- Type a single character to replace the selected text
- Observe: the character does not replace the text
Actual (Problematic) Behavior
RTL selections are not immediately replaced by a valid character, the first keypress is ignored.
Expected Behavior
The text replacement should occur immediately, after the first keypress, regardless of the selection direction.
Additional Context
editContext: false is a necessary workaround for #5081. Users who need that fix now hit this RTL bug.
Workaround
Intercept keydown and use editor.trigger() for RTL selections
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels