Skip to content

Commit 6c4f453

Browse files
javier-godoypaodb
authored andcommitted
fix: fill the parent container after navigation
Close #35
1 parent a499b0e commit 6c4f453

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/resources/META-INF/frontend/fc-xterm/xterm-fit-mixin.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ class FitAddon extends FitAddonBase {
3535
const super_fit = this.fit.bind(this);
3636
this.fit = () => {
3737
super_fit();
38-
this.__unsetWidth();
3938
requestAnimationFrame(()=>this.__unsetWidth());
4039
};
4140
}
4241

4342
__unsetWidth() {
44-
(this.$.node.terminal as any)._core.viewport._viewportElement.style.width='unset';
43+
let viewport = (this.$.node.terminal as any)._core.viewport;
44+
if (viewport) viewport._viewportElement.style.width='unset';
4545
}
4646

4747
activate(terminal: Terminal): void {
@@ -85,7 +85,7 @@ export function XTermFitMixin<TBase extends Constructor<TerminalMixin>>(Base: TB
8585

8686
fit() {
8787
this._fitAddon.proposeDimensions();
88-
window.requestAnimationFrame(()=>{
88+
window.setTimeout(()=>{
8989
try {
9090
this._fitAddon?.fit();
9191
} catch (e) {

0 commit comments

Comments
 (0)