Auto scroll not working when viewport height is set
See original GitHub issueDetails
- 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:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks, I finally figured it out though. Nested flexboxes. I had to
display: flex
on the terminal element thenmargin-top: auto
on the viewport.Good luck 😃