diff --git a/src/components/CollapsibleText/CollapsibleText.tsx b/src/components/CollapsibleText/CollapsibleText.tsx index 38e01cb93..4e648fd6b 100644 --- a/src/components/CollapsibleText/CollapsibleText.tsx +++ b/src/components/CollapsibleText/CollapsibleText.tsx @@ -21,10 +21,13 @@ const CollapsibleText: React.FC = ({ text, className, maxHeight = 'none' const ariaLabel = expanded ? 'Collapse' : 'Expand'; + const clippablePixels = 4; + useEffect(() => { divRef.current && setDoesFlowOver( - divRef.current.scrollHeight > divRef.current.offsetHeight || (maxHeight < divRef.current.offsetHeight && maxHeight !== 'none'), + divRef.current.scrollHeight > divRef.current.offsetHeight + clippablePixels || + (maxHeight < divRef.current.offsetHeight && maxHeight !== 'none'), ); }, [maxHeight, text, breakpoint]);