microsoft / microsoft/monaco-editor
[Bug] Setting tabFocusMode on initial monaco.editor.create does not properly set value
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 46.8k
- Forks
- 4.1k
- Avg merge
- 17h 58m
- Merged PRs (30d)
- 1
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!');
}`;
// Hover on each property to see its docs!
const myEditor = monaco.editor.create(document.getElementById("container"), {
value,
language: "javascript",
automaticLayout: true,
tabFocusMode: true, // This does not work
});
//Workaround
myEditor.trigger("Test", "editor.action.toggleTabFocusMode", true); //Have to manually do this
Reproduction Steps
Comment out the "myEditor.trigger" command. See that you get tab trapping. Uncomment it, and see that workaround fixes it.
Actual (Problematic) Behavior
As far as I can tell from documentation, the tabFocusMode property is supposed to set the toggletabfocusMode on the editor, but it does not seem to do that.
Expected Behavior
Setting tabFocusMode to true should automatically disable tab trapping
Additional Context
There is a workaround for now, but it seems like the setup feature is incorrect.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Monaco Editor Playground link and the provided create call, comparing tabFocusMode: true with the editor.action.toggleTabFocusMode workaround. Verify the initial option's behavior with the reproduction steps and determine whether it matches the expected disabling of tab trapping. Done means the initial setting behaves like the workaround without requiring myEditor.trigger.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100