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

Editor line-height 'pops' after loading. #224

Open
viridia opened this issue Jun 20, 2017 · 4 comments
Open

Editor line-height 'pops' after loading. #224

viridia opened this issue Jun 20, 2017 · 4 comments

Comments

@viridia
Copy link

viridia commented Jun 20, 2017

Problem

When the editor first loads, the lines of text are vertically squished as if the line-height property were set to about half the normal value. After about 1/2 a second, the editor repaints and the lines look normal.

I've attempted to work around this in a bunch of ways (explicitly setting line-height in the css for example) and none of my efforts have had any effect.

This is mainly a cosmetic issue, it doesn't affect editor functionality but it does look unsightly.

Here are two screen shots showing what it looks like before and after the pop:

editor_before

editor_after

Sample code to reproduce your issue

My editor configuration is fairly minimal, the only thing unusual is that I'm using percentages for width and height:

<AceEditor
  mode={mode}
  theme="twilight"
  width="100%"
  height="100%"
  focus
  tabSize={2}
  ref={el => { this.editor = el; }}
  editorProps={{ $blockScrolling: true }} />
@securingsincity securingsincity modified the milestones: 5.0.2, 5.1.0 Jul 4, 2017
@fumblehool
Copy link
Contributor

@securingsincity Is it still open? Can I work on this one?

@kaiyoma
Copy link

kaiyoma commented Mar 28, 2018

I'm running into this as well and it's a bit unsightly as the contents of the editor can change frequently/easily and the line height "pops" every time. Will this be fixed soon?

@samratshaw
Copy link

samratshaw commented Apr 10, 2018

This is due to the fact that the line height is being calculated at run time.
Till the time the actual fix is rolled out, you can use the below hack.

Override the .ace_line css class with the minimum height that your code block is expected to render.

You can see what is the actual height that your editor is rendering using developer tools.
Use this as minHeight inside the overriden .ace_line class.

screen shot 2018-04-10 at 4 30 05 pm

@isaacjwilliams
Copy link

Any word on if this will actually be fixed? Still seeing it.

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

No branches or pull requests

6 participants