question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Auto scroll not working when viewport height is set

See original GitHub issue

Details

  • Browser and browser version: Chrome/Atom 1.18
  • OS version: Manjaro
  • xterm.js version: 2.9.2

Steps to reproduce

I’m trying to remove the half line gap below the viewport as described in https://github.com/sourcelair/xterm.js/issues/762. My method is to set the height on the viewport after an element resize event:

this.resizeObserver = new ResizeObserver(() => {
      this.terminal.fit()
      // fix the half row gap at bottom of terminal
      this.terminal.viewportElement.style.height = this.refs.xterm.clientHeight + 'px'
});
this.resizeObserver.observe(this.refs.xterm);

While this works, the side affect is when calling Terminal.write it no longer auto scrolls to the bottom.

Is there anything I can do to get the desired behaviour?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
twiftycommented, Sep 2, 2017

Thanks, I finally figured it out though. Nested flexboxes. I had to display: flex on the terminal element then margin-top: auto on the viewport.

0reactions
Tyriarcommented, Sep 2, 2017

Good luck 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Auto scrolling breaking height restrictions - css - Stack Overflow
I have tried every height manipulation of .action-list possible to no avail. I was able to make the whole thing fit perfectly if...
Read more >
overflow - CSS: Cascading Style Sheets - MDN Web Docs
In order for overflow to have an effect, the block-level container must have either a set height ( height or max-height ) or...
Read more >
How to prevent overflow scrolling in CSS - LogRocket Blog
This is the scrolling overflow problem related to our CSS styling. ... With the auto value, the content that is not visible in...
Read more >
Element size and scrolling - The Modern JavaScript Tutorial
Properties scrollLeft/scrollTop are the width/height of the hidden, scrolled out part of the element. On the picture below we can see ...
Read more >
CSS: Hiding in plain sight. The mysteries of scrolling ... - Medium
Here's what I knew: the viewport height on my menu was set to 100, so all of it should be visible no matter...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found