From 74fc43020a29ce9fd6aa40dde66c76bb3d17f485 Mon Sep 17 00:00:00 2001 From: Himself65 Date: Fri, 17 Mar 2023 19:32:00 -0400 Subject: [PATCH] fix: side bar favorited list cannot scroll (#1606) Co-authored-by: sheben404 --- .../components/pure/workspace-slider-bar/index.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/apps/web/src/components/pure/workspace-slider-bar/index.tsx b/apps/web/src/components/pure/workspace-slider-bar/index.tsx index 2085dec7df..1b8efe0512 100644 --- a/apps/web/src/components/pure/workspace-slider-bar/index.tsx +++ b/apps/web/src/components/pure/workspace-slider-bar/index.tsx @@ -49,8 +49,15 @@ const FavoriteList: React.FC = ({ () => pageMeta.filter(p => p.favorite && !p.trash), [pageMeta] ); + return ( - + {favoriteList.map((pageMeta, index) => { const active = router.query.pageId === pageMeta.id; return ( @@ -58,6 +65,11 @@ const FavoriteList: React.FC = ({ { + if (ref && active) { + ref.scrollIntoView({ behavior: 'smooth' }); + } + }} onClick={() => { if (active) { return;