From 77c1c2083946b29890c4fc69934f8d694648c228 Mon Sep 17 00:00:00 2001 From: AramJonghu Date: Sat, 13 Jun 2026 15:27:40 +0200 Subject: [PATCH] autoscroll fix --- frontend/src/pages/Stream.jsx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/frontend/src/pages/Stream.jsx b/frontend/src/pages/Stream.jsx index 5cd76bc..223ec3a 100644 --- a/frontend/src/pages/Stream.jsx +++ b/frontend/src/pages/Stream.jsx @@ -1,4 +1,4 @@ -import { useState, useEffect } from "react"; +import { useState, useRef, useEffect } from "react"; const streams = [ { id: "aramstream", label: "Aram" }, @@ -8,15 +8,22 @@ const streams = [ export default function Stream() { const [activeStream, setActiveStream] = useState("aramstream"); + const headerRef = useRef(null); useEffect(() => { - window.scrollTo({ top: 0, behavior: "smooth" }); - }, [activeStream]); + headerRef.current?.scrollIntoView({ + behavior: "smooth", + block: "start", + }); + }, []); return (
-

+

Stream

@@ -36,7 +43,7 @@ export default function Stream() { ))}
-
+