Fix fit addon to get the scroll bar working in the demo

This commit is contained in:
Daniel Imms
2024-07-09 13:34:51 -07:00
parent c33ed46161
commit 381200bce1
3 changed files with 80 additions and 4 deletions
+3 -2
View File
@@ -64,8 +64,9 @@ export class FitAddon implements ITerminalAddon , IFitApi {
return undefined;
}
const scrollbarWidth = this._terminal.options.scrollback === 0 ?
0 : core.viewport.scrollBarWidth;
const scrollbarWidth = (this._terminal.options.scrollback === 0
? 0
: (this._terminal.options.overviewRulerWidth || 14));
const parentElementStyle = window.getComputedStyle(this._terminal.element.parentElement);
const parentElementHeight = parseInt(parentElementStyle.getPropertyValue('height'));