Skip to content

Commit

Permalink
refine scroll to bottom behavior
Browse files Browse the repository at this point in the history
scroll only to the last replay, not all the way to the copy controls
  • Loading branch information
jmlee337 committed Jul 20, 2024
1 parent 6485fb0 commit 291d8a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/renderer/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ function Hello() {
const copyControlsRef = useRef<HTMLDivElement | null>(null);
useEffect(() => {
if (scrollToBottom && copyControlsRef.current) {
copyControlsRef.current.scrollIntoView();
copyControlsRef.current.scrollIntoView(false);
}
}, [replayLoadCount, scrollToBottom]);
const chooseDir = async () => {
Expand Down Expand Up @@ -1674,6 +1674,7 @@ function Hello() {
Folder not found
</Alert>
)}
<div ref={copyControlsRef} />
<CopyControls
dir={copyDir}
setDir={setCopyDir}
Expand All @@ -1691,7 +1692,6 @@ function Hello() {
setCopySettings(newCopySettings);
}}
/>
<div ref={copyControlsRef} />
</TopColumn>
<TopColumn width="300px">
<SearchBox
Expand Down

0 comments on commit 291d8a2

Please sign in to comment.