diff --git a/src/components/Player/OutputBox/TextBuffer.jsx b/src/components/Player/OutputBox/TextBuffer.jsx index eaa149a..4a10266 100644 --- a/src/components/Player/OutputBox/TextBuffer.jsx +++ b/src/components/Player/OutputBox/TextBuffer.jsx @@ -67,12 +67,12 @@ export default function TextBuffer ({ inbox, currentWindow }) { const lastInput = inputs[inputs.length - 1] - textBufferEl.current.scrollTo({ - top: lastInput - ? lastInput.offsetTop - : textBufferEl.current.scrollHeight, - behavior: 'smooth', - }) + lastInput + ? lastInput.scrollIntoView() + : textBufferEl.current.scrollTo({ + top: textBufferEl.current.scrollHeight, + behavior: 'smooth', + }) }, 0) }, [currentWindow, inbox]) diff --git a/src/components/Player/player.css b/src/components/Player/player.css index 7d0f047..c1d5bd3 100644 --- a/src/components/Player/player.css +++ b/src/components/Player/player.css @@ -103,6 +103,7 @@ } .ifplayer .output .textBuffer .message.input { + scroll-margin-top: var(--inner-padding); color: var(--input-color); }