mirror of
https://github.com/He4eT/elseifplayer.git
synced 2026-05-05 01:17:22 +00:00
TextBuffer: smooth scrolling
This commit is contained in:
parent
b08d9725d4
commit
393d15a64f
2 changed files with 6 additions and 3 deletions
|
|
@ -67,10 +67,12 @@ export default function TextBuffer ({ inbox, currentWindow }) {
|
||||||
const lastInput =
|
const lastInput =
|
||||||
inputs[inputs.length - 1]
|
inputs[inputs.length - 1]
|
||||||
|
|
||||||
textBufferEl.current.scrollTop =
|
textBufferEl.current.scrollTo({
|
||||||
lastInput
|
top: lastInput
|
||||||
? lastInput.offsetTop
|
? lastInput.offsetTop
|
||||||
: textBufferEl.current.scrollHeight * 2
|
: textBufferEl.current.scrollHeight,
|
||||||
|
behavior: 'smooth',
|
||||||
|
})
|
||||||
}, 0)
|
}, 0)
|
||||||
}, [currentWindow, inbox])
|
}, [currentWindow, inbox])
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,7 @@
|
||||||
.ifplayer .output .textBuffer {
|
.ifplayer .output .textBuffer {
|
||||||
flex: 2 1;
|
flex: 2 1;
|
||||||
outline: none;
|
outline: none;
|
||||||
|
scroll-behavior: smooth;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ifplayer .output .textBuffer > br:first-child,
|
.ifplayer .output .textBuffer > br:first-child,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue