[READ-ONLY] Mirror of https://github.com/thang-qt/ThreadLine. Alternative frontend for HackerNews and Lobsters threadline.thangqt.com/
0

Configure Feed

Select the types of activity you want to include in your feed.

fix(reader): prevent body scrolling and scroll jump when opening overlay viewer

Quang Thang (Jul 22, 2026, 7:42 PM +0700) ce5a405d 39592435

+11 -2
+11 -2
src/components/discussion/DiscussionView.tsx
··· 29 29 30 30 useEffect(() => { 31 31 if (!overlay) return; 32 - dialogRef.current?.focus(); 32 + 33 + const originalOverflow = document.body.style.overflow; 34 + document.body.style.overflow = 'hidden'; 35 + 36 + dialogRef.current?.focus({ preventScroll: true }); 37 + 33 38 const onKeyDown = (event: KeyboardEvent) => { 34 39 if (event.key === 'Escape') onClose?.(); 35 40 }; 36 41 window.addEventListener('keydown', onKeyDown); 37 - return () => window.removeEventListener('keydown', onKeyDown); 42 + 43 + return () => { 44 + window.removeEventListener('keydown', onKeyDown); 45 + document.body.style.overflow = originalOverflow; 46 + }; 38 47 }, [overlay, onClose]); 39 48 40 49 const toggle = (commentId: string) => setCollapsed(old => {