mirror of
https://github.com/esphome/esp-web-tools.git
synced 2025-07-28 06:06:36 +00:00
Fix console not staying at bottom if new line spanned two lines (#302)
This commit is contained in:
parent
98891ab73f
commit
de749bd83e
@ -178,13 +178,14 @@ export class ColoredConsole {
|
||||
}
|
||||
}
|
||||
}
|
||||
const atBottom =
|
||||
this.targetElement.scrollTop >
|
||||
this.targetElement.scrollHeight - this.targetElement.offsetHeight - 50;
|
||||
|
||||
addSpan(line.substring(i));
|
||||
|
||||
if (
|
||||
this.targetElement.scrollTop + 56 >=
|
||||
this.targetElement.scrollHeight - this.targetElement.offsetHeight
|
||||
) {
|
||||
// at bottom
|
||||
// Keep scroll at bottom
|
||||
if (atBottom) {
|
||||
this.targetElement.scrollTop = this.targetElement.scrollHeight;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user