microsoft / microsoft/monaco-editor

[Bug] The editor isn't visible when the page direction is RTL

Open
#4,869 0 comments 1 reaction 0 assignees View on GitHub

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?
Monaco Editor Playground Link

https://microsoft.github.io/monaco-editor/playground.html?source=v0.52.2#XQAAAAJyAQAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscwzX_uRgmSaumWUF-TBOsVJ4S4FwfCDQb5-2uUHXTVAefbVSd9IzaZ_vv9VR9KugsKimARHSWlrTPOQHROITHxmAfWyxxqJxKmhw1cKTUXC0tx2LpbUNTPmPakHwRDCMzdoAiklOMc0p3Nr1fBa5SNIwkn6xD0gCTG5vcEJD-YrwETkeoWK28F2pb0Xq2fx4k1Ro7TuHxRZ1iSvU7MtPNYGKzp0ebj-RR9nalP9jmhdCOn5j5ER-RZjhXLtDzaRkrurbfokzAEOcnE5RBpV-y-cxtaDh4MvXt5X0fYKHVPFBdIugcoOItMgVJe_PwqXNY

Monaco Editor Playground Code

Reproduction Steps
  1. Open the Monaco editor playground.
  2. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.