TextBuffer: smooth scrolling

This commit is contained in:
He4eT 2023-05-24 01:21:30 +03:00 committed by Alexey
commit 393d15a64f
2 changed files with 6 additions and 3 deletions

View file

@ -67,10 +67,12 @@ export default function TextBuffer ({ inbox, currentWindow }) {
const lastInput =
inputs[inputs.length - 1]
textBufferEl.current.scrollTop =
lastInput
textBufferEl.current.scrollTo({
top: lastInput
? lastInput.offsetTop
: textBufferEl.current.scrollHeight * 2
: textBufferEl.current.scrollHeight,
behavior: 'smooth',
})
}, 0)
}, [currentWindow, inbox])

View file

@ -78,6 +78,7 @@
.ifplayer .output .textBuffer {
flex: 2 1;
outline: none;
scroll-behavior: smooth;
}
.ifplayer .output .textBuffer > br:first-child,