Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stop code wrap #112

Open
jashwanth999 opened this issue Apr 20, 2022 · 6 comments
Open

stop code wrap #112

jashwanth999 opened this issue Apr 20, 2022 · 6 comments

Comments

@jashwanth999
Copy link

Is there any way to stop code wrap and make it horizontal scroll
image

@jaywcjlove
Copy link
Member

This can not be achieved, it can only be so simple.
@jashwanth999 There are more complex options here:

https://github.com/jaywcjlove/react-monacoeditor
https://github.com/uiwjs/react-codemirror

@vangelov
Copy link

@jaywcjlove I just wonder why something like overflow-wrap: normal does not work here?

@jaywcjlove
Copy link
Member

@vangelov This highlighting is implemented by overlapping pre and textarea. Maybe this is why overflow-wrap: normal doesn't work.

@vangelov
Copy link

Oh, I see. Thanks for the answer.

@mskafo
Copy link

mskafo commented Oct 16, 2023

so there's nothing to do?

@nnnnat
Copy link

nnnnat commented Jul 22, 2024

I was able to prevent the code from text wrapping by nesting the CodeEditor inside a div with overflow: auto; and setting the width on the CodeEditor to max-content.

<div style={{ overflow: 'auto', }}>
  <CodeEditor style={{ width: 'max-content', }} />
</div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants