From de0da11cc0c8fd030e9536653c9515daa78accdf Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sat, 25 Jan 2025 21:19:43 +0800 Subject: [PATCH] Fix j/k not skipping over display:none items Hide-filtered posts are display:none-d --- src/components/timeline.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/timeline.jsx b/src/components/timeline.jsx index 526cbbc05..0619dc5a6 100644 --- a/src/components/timeline.jsx +++ b/src/components/timeline.jsx @@ -149,7 +149,7 @@ function Timeline({ const activeItemRect = activeItem?.getBoundingClientRect(); const allItems = Array.from( scrollableRef.current.querySelectorAll(itemsSelector), - ); + ).filter((item) => !!item.offsetHeight); if ( activeItem && activeItemRect.top < scrollableRef.current.clientHeight && @@ -188,7 +188,7 @@ function Timeline({ const activeItemRect = activeItem?.getBoundingClientRect(); const allItems = Array.from( scrollableRef.current.querySelectorAll(itemsSelector), - ); + ).filter((item) => !!item.offsetHeight); if ( activeItem && activeItemRect.top < scrollableRef.current.clientHeight &&