[Bug] The editor isn't visible when the page direction is RTL
Reproducible in vscode.dev or in VS Code Desktop?
- [x] 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
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
- 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! :)