From 0c0134144d95889e20a0ab65b3a2447605822235 Mon Sep 17 00:00:00 2001 From: Titonatos Date: Wed, 16 Oct 2024 18:27:32 +0300 Subject: [PATCH] Issue_#1979/Auto scroll to latest message --- .../codebattle/assets/js/widgets/components/Messages.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/app/apps/codebattle/assets/js/widgets/components/Messages.jsx b/services/app/apps/codebattle/assets/js/widgets/components/Messages.jsx index 7e2d70505..db3874f15 100644 --- a/services/app/apps/codebattle/assets/js/widgets/components/Messages.jsx +++ b/services/app/apps/codebattle/assets/js/widgets/components/Messages.jsx @@ -17,12 +17,12 @@ const getKey = (id, time, name) => { function Messages({ messages, displayMenu = () => {}, disabled = false }) { const listRef = useRef(); - const { stayScrolled /* , scrollBottom */ } = useStayScrolled(listRef); + const { /*stayScrolled ,*/ scrollBottom } = useStayScrolled(listRef); // Typically you will want to use stayScrolled or scrollBottom inside // useLayoutEffect, because it measures and changes DOM attributes (scrollTop) directly useLayoutEffect(() => { - stayScrolled(); - }, [messages.length, stayScrolled]); + scrollBottom(); + }, [messages.length, scrollBottom]); if (disabled) { return (