fix missing view more? #687

This commit is contained in:
keyan 2023-12-15 18:18:30 -06:00
parent d3fac7f968
commit 3a7d899ce7
1 changed files with 11 additions and 2 deletions

View File

@ -40,8 +40,17 @@ export default memo(function Text ({ nofollow, imgproxyUrls, children, tab, ...o
const container = containerRef.current
if (!container || overflowing) return
setOverflowing(container.scrollHeight > window.innerHeight * 2)
}, [containerRef.current])
function checkOverflow () {
setOverflowing(container.scrollHeight > window.innerHeight * 2)
}
window.addEventListener('resize', checkOverflow)
checkOverflow()
return () => {
window.removeEventListener('resize', checkOverflow)
}
}, [containerRef.current, setOverflowing])
// all the reactStringReplace calls are to facilitate search highlighting
const slugger = useRef(new GithubSlugger())