diff --git a/src/components/player/TextBuffer.jsx b/src/components/player/TextBuffer.jsx index 46541c2..b79ab67 100644 --- a/src/components/player/TextBuffer.jsx +++ b/src/components/player/TextBuffer.jsx @@ -54,8 +54,15 @@ export default function ({ inbox, currentWindow }) { : messages.concat(incoming)) setTimeout(() => { + const inputs = + textBufferEl.current.querySelectorAll('.message.input') + const lastInput = + inputs[inputs.length- 1] + textBufferEl.current.scrollTop = - textBufferEl.current.scrollHeight * 2 + lastInput + ? lastInput.offsetTop + : textBufferEl.current.scrollHeight * 2 }, 0) }, [inbox])