monaco-editor icon indicating copy to clipboard operation
monaco-editor copied to clipboard

[Bug] Some text keystrokes do not work in Firefox when accessibilitySupport = on

Open antrayner opened this issue 8 months ago • 1 comments

Reproducible in vscode.dev or in VS Code Desktop?

  • [ ] Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

https://microsoft.github.io/monaco-editor/playground.html?source=v0.52.2#XQAAAAJ6AQAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscwziDVO_1uhs0-3YGTBOsVJ4S4FwfCDQb5-2uUHXTVAefbVSd9IzaZ_vv9VR9KugsKimARHSWlrTPOQHROITHxmAetfeRrm3VHdSe7_Etv6WpgzlH4vE8EOD3EPhJDl6tDpOO8RxKZbUytKns3T0NFFloo9Q21KsEBT298I6cyZc5-Glup9UHU6QTpv2Hjab6pZzB3ZO2RH-WGhzXse2-hNlgz6zCgsG8AjiqGg0ZzWzND7z09NmCQOQd6pfkNvO2zmMzFvHpTY8RFEy1urlQcQMaso8TJINYBUpqH_RupAfPCERXHZP2ZE1LguZR1qpiZnP9EPHsA

Note: Reproducible in playground. Not reproducible in VC Code Desktop.

Monaco Editor Playground Code

const value = /* set from `myEditor.getModel()`: */ `function hello() {
	alert('Hello world!');
}`;

// Hover on each property to see its docs!
const myEditor = monaco.editor.create(document.getElementById("container"), {
	value,
	language: "javascript",
	automaticLayout: true,
	accessibilitySupport: "on"
});

Reproduction Steps

Note: Only occurs in Firefox and on Windows. Works fine with Chrome on Windows. Also works fine in FF on macOS.

  1. Go to Preview window and place cursor anywhere in the editor.
  2. Try to use standard Windows keyboard shortcut Control + Right Arrow, or Control + Left Arrow to move to beginning of next word / previous word. Nothing happens.
  3. Additionally, try to select next / previous word with Shift + Control + Right / Left Arrow. Observe nothing happens.

Update playground code to set accessibilitySupport: "off", and observe issue does not reproduce.

Also note: Does not reproduce on Mac, but Mac uses different OS commands for similar functionality (Alt+(Shift+)Left/Right).

Actual (Problematic) Behavior

accessibilitySupport setting interferes with OS default text keystroke behaviour in Firefox. Works in Chrome.

Expected Behavior

accessibilitySupport setting should not interfere with this behaviour.

Additional Context

No response

antrayner avatar May 02 '25 15:05 antrayner

I can reproduce this issue. It makes using VSCode and code-server very annoying in Firefox:

You can see that I now need two key presses to replace text that is selected with the keyboard:

https://github.com/user-attachments/assets/086d2be8-a7ca-4d47-95a0-3a7ca9006799

Meanwhile it works fine in Chrome:

https://github.com/user-attachments/assets/f4890e82-7beb-4c96-842a-cbf03c8183e6

ading2210 avatar Dec 09 '25 18:12 ading2210