From 1aebe44dcdd602903bb4f906459d68f2c9575aca Mon Sep 17 00:00:00 2001 From: Antonella Sgarlatta Date: Tue, 1 Jun 2021 12:17:06 -0300 Subject: [PATCH] feat: use opacity for overflowed tags animation --- .../javascripts/components/NoteTags.tsx | 19 +++++++------------ app/assets/stylesheets/_sn.scss | 12 ++++++++++++ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/app/assets/javascripts/components/NoteTags.tsx b/app/assets/javascripts/components/NoteTags.tsx index 259835ca2..112877416 100644 --- a/app/assets/javascripts/components/NoteTags.tsx +++ b/app/assets/javascripts/components/NoteTags.tsx @@ -28,8 +28,6 @@ const NoteTags = observer(({ application, appState }: Props) => { const [containerHeight, setContainerHeight] = useState(TAGS_ROW_HEIGHT); - const [tagsContainerHeight, setTagsContainerHeight] = - useState(TAGS_ROW_HEIGHT); const [overflowCountPosition, setOverflowCountPosition] = useState(0); const containerRef = useRef(); @@ -90,13 +88,6 @@ const NoteTags = observer(({ application, appState }: Props) => { ? tagsContainerRef.current.scrollHeight : TAGS_ROW_HEIGHT; setContainerHeight(containerHeight); - - const firstTagTop = tagsRef.current[0].getBoundingClientRect().top; - const lastTagBottom = tagsRef.current[tagsRef.current.length - 1].getBoundingClientRect().bottom; - const tagsContainerHeight = tagsContainerExpanded - ? lastTagBottom - firstTagTop - : TAGS_ROW_HEIGHT; - setTagsContainerHeight(tagsContainerHeight); }, [tagsContainerExpanded]); const reloadOverflowCount = useCallback(() => { @@ -134,17 +125,21 @@ const NoteTags = observer(({ application, appState }: Props) => { >
{tags.map((tag: SNTag, index: number) => (