From 3d38b22fee4d8cf3d1a6fd5949615bc4cdf9c61b Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Sat, 28 Feb 2026 17:31:08 +0000 Subject: [PATCH] Scroll to top of article page when viewing new content Ensure the page scrolls to the top when a new article slug is loaded by adding a useEffect hook. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 413891e8-d784-4bea-b9f5-91a5a68316b4 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 87110da8-2cc4-433f-9d49-0af7ca1b4fa5 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/413891e8-d784-4bea-b9f5-91a5a68316b4/kmpcO4B Replit-Helium-Checkpoint-Created: true --- client/src/pages/article.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/src/pages/article.tsx b/client/src/pages/article.tsx index 4a028e0..8072a1b 100644 --- a/client/src/pages/article.tsx +++ b/client/src/pages/article.tsx @@ -97,6 +97,10 @@ export default function ArticlePage() { queryKey: ["/api/articles", slug], }); + useEffect(() => { + window.scrollTo(0, 0); + }, [slug]); + useEffect(() => { if (!article?.content) return; if (article.content.includes("instagram.com")) {