Skip to content

feat: add noWrap #36

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nihgwu
Copy link

@nihgwu nihgwu commented Jun 30, 2019

Motivation

I managed to make the editor scrollable horizontally, see https://nihgwu.github.io/react-runner/, but it's kind of hacky, as there is no way to set the inner elements' style via props, so I have to add !important to override the default style here https://github.com/nihgwu/react-runner/blob/master/website/src/components/LiveRunner.js#L37

Another options is change this line to whiteSpace: 'inherit', and move whiteSpace: 'pre-wrap', to the container section, so I can override it via style without !important

Test plan

@AlecR
Copy link

AlecR commented Aug 2, 2020

@satya164 Any plans to add this feature?

@zirkelc
Copy link

zirkelc commented Jul 25, 2021

I checked your code on react runner and some additional CSS was necessary for me to get horizontally scrolling working:

  • change white-space: pre-wrap to white-space: pre !important; on the textarea and pre tag within the editor styles
  • add float:left and min-height: 100% and min-width: 100% to the editor styles
  • add overflow: auto and height: 100% and width: 100% to the parent container of the editor

The float: left was key to get it working - still not sure why :-D

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

Successfully merging this pull request may close these issues.

3 participants