microsoft / microsoft/monaco-editor
[Bug] The editor isn't visible when the page direction is RTL
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
Reproduction Steps
- Open the Monaco editor playground.
- Don't change the default values. Set the CSS to
body {direction:rtl}.
Actual (Problematic) Behavior
The editor disappears (apparently rendered beyond the viewport).
Expected Behavior
The editor should remain visible and usable. It should probably remain LTR even when the rest of the page is RTL.
Additional Context
Manually adding direction: ltr to the CSS of the container div seems to fix it.
I found a past issues that might help find a good fix https://github.com/microsoft/monaco-editor/issues/4141
IMPORTANT: This isn't a request to add RTL support to the editor. It's a request to make the editor work (in LTR direction) when embedded in an RTL page, without needing any additional hacks.
Thanks! :)
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 by reproducing the problem in the linked Monaco Editor Playground with body {direction:rtl} and compare it with the workaround that adds direction: ltr to the container. Read the related issue #4141 for context, then trace the editor container's layout behavior. Done means the editor remains visible and usable inside an RTL page without an external CSS hack; verify the playground reproduction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, javascript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100