From 2b5eb87ec48f2fc7d1f4350bea818b1499b34f67 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Fri, 12 May 2023 11:57:10 +0800 Subject: [PATCH] Fix double scrolling when clicking on announcement index buttons --- src/pages/notifications.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/notifications.jsx b/src/pages/notifications.jsx index 61675ec7..6ece5c3c 100644 --- a/src/pages/notifications.jsx +++ b/src/pages/notifications.jsx @@ -253,7 +253,10 @@ function Notifications() { onClick={() => { announcementsListRef.current?.children[ index - ].scrollIntoView({ behavior: 'smooth' }); + ].scrollIntoView({ + behavior: 'smooth', + block: 'nearest', + }); }} > {index + 1}