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

[Bug] Word-wrapping turns text invisible when size-constrained

Open daniel-dewa opened this issue 3 months ago • 1 comments

Describe the bug The editor completely hides a "word-wrapped" line when the line is sufficiently long.

To Reproduce

  • Create new React 19 project: pnpm create vite@latest
  • Add @monaco-editor/react dependency: pnpm add @monaco-editor/react
  • Initialize monaco <Editor /> with wordWrap enabled in a height/width constrained div. Se playground / example code.

I have created reproducible GitHub and StackBlitz projects, showing the issue:

Expected behavior I expect the word-wrapping to keep showing the line while scrolling.

Screenshots

Image

Desktop (please complete the following information):

  • OS: Linux, Fedora 42
  • Browser: Tested on Firefox & Chromium
  • Version 4.7.0

Additional context I have also created an issue under the monaco project: https://github.com/microsoft/monaco-editor/issues/5005

daniel-dewa avatar Sep 17 '25 13:09 daniel-dewa

After further research, it seems like the issue has been fixed in Monaco 0.53.0. Monac react uses Monaco 0.52.2, which reproduces the issue in the monaco editor playground. As far as I can see the issue was introduced in 0.52.0 and did not exist in 0.51.0:

Image

The reason I was having this issue is because @monaco-editor/[email protected] (latest) uses @monaco-editor/[email protected] (latest) uses [email protected] (old release).

daniel-dewa avatar Oct 07 '25 08:10 daniel-dewa