From 23f935aeebf86d87836e34da07af27369d0d1462 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Fri, 8 Nov 2019 12:36:12 +0700 Subject: [PATCH] added recalc on cell display change --- src/components/flow/Cell/index.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/flow/Cell/index.tsx b/src/components/flow/Cell/index.tsx index b5db69bb..f21d2326 100644 --- a/src/components/flow/Cell/index.tsx +++ b/src/components/flow/Cell/index.tsx @@ -46,6 +46,11 @@ const Cell: FC = ({ checkIfVisible(); }, []); + useEffect(() => { + // recalc visibility of other elements + window.dispatchEvent(new CustomEvent('scroll')); + }, [flow]); + useEffect(() => { window.addEventListener('scroll', checkIfVisibleDebounced);