Skip to content

Commit 4497603

Browse files
authored
Fixed buggy autoscroll (#2574)
1 parent 52ebdc2 commit 4497603

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

react_main/src/pages/Game/Game.jsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,15 +1494,10 @@ export function TextMeetingLayout() {
14941494
}, []);
14951495

14961496
function doAutoScroll() {
1497-
const container = speechDisplayRef.current;
1497+
const container = speechDisplayRef.current;
14981498
if (autoScroll && container) {
14991499
requestAnimationFrame(() => {
1500-
if (container) {
1501-
const lastChild = container.lastElementChild;
1502-
if (lastChild && typeof lastChild.scrollIntoView === "function") {
1503-
lastChild.scrollIntoView();
1504-
}
1505-
}
1500+
container.scrollTo(0, container.scrollHeight);
15061501
});
15071502
}
15081503
}

0 commit comments

Comments
 (0)