fix(site): add resize observer to session timeline expandable text (#24119)

I said I wouldn't but the illustrious @jakehwll added a ResizeObserver
recently so imma do that too.

This makes `<ExpandableText>` determine if it should be expandable or
not on resize
This commit is contained in:
Jeremy Ruppel
2026-04-07 19:04:05 -04:00
committed by GitHub
parent 027c222e82
commit 36cf7debce
@@ -48,7 +48,18 @@ const ExpandableText: FC<ExpandableTextProps> = ({
useEffect(() => {
const el = contentRef.current;
if (!el) return;
setIsExpandable(el.scrollHeight > maxHeight);
const checkIsExpandable = () => {
setIsExpandable(el.scrollHeight > maxHeight);
};
checkIsExpandable();
const observer = new ResizeObserver(checkIsExpandable);
observer.observe(el);
return () => observer.disconnect();
}, [maxHeight]);
return (