From 76a33b6f905bac61f6390b01b13c6a43b94f535f Mon Sep 17 00:00:00 2001 From: Innei Date: Sat, 7 Sep 2024 14:46:53 +0800 Subject: [PATCH] fix: feed list can switch view, fix #278 Signed-off-by: Innei --- .../src/modules/feed-column/index.tsx | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/src/renderer/src/modules/feed-column/index.tsx b/src/renderer/src/modules/feed-column/index.tsx index 63a5698850..dfaca26348 100644 --- a/src/renderer/src/modules/feed-column/index.tsx +++ b/src/renderer/src/modules/feed-column/index.tsx @@ -177,7 +177,10 @@ export function FeedColumn({ children }: PropsWithChildren) { ))} -
+
{views.map((item, index) => (
(null) - // useLayoutEffect(() => { - // const $container = containerRef.current; - // if (!$container) return; - - // const x = -active * feedColumnWidth; - // // NOTE: To fix the misalignment of the browser's layout, use display to re-render it. - // if (x !== $container.getBoundingClientRect().x) { - // $container.style.display = "none"; - - // nextFrame(() => { - // $container.style.display = ""; - // }); - // } - // }, []); - const prevActiveIndexRef = useRef(-1) const [isReady, setIsReady] = useState(false) @@ -248,7 +236,14 @@ const SwipeWrapper: FC<{ }, [active]) if (reduceMotion) { - return
{children}
+ return ( +
+ {children[currentAnimtedActive]} +
+ ) } return (