diff --git a/frontend/src/components/layout/Sidebar.tsx b/frontend/src/components/layout/Sidebar.tsx index c092601f..9008b106 100644 --- a/frontend/src/components/layout/Sidebar.tsx +++ b/frontend/src/components/layout/Sidebar.tsx @@ -112,8 +112,27 @@ export function Sidebar() { } } + const handleSidebarWheel = (e: React.WheelEvent) => { + const sidebar = e.currentTarget + const canSidebarScroll = sidebar.scrollHeight > sidebar.clientHeight + const atTop = sidebar.scrollTop <= 0 + const atBottom = sidebar.scrollTop + sidebar.clientHeight >= sidebar.scrollHeight - 1 + + // If sidebar can't consume wheel movement, forward it to main content scroller. + if (!canSidebarScroll || (e.deltaY < 0 && atTop) || (e.deltaY > 0 && atBottom)) { + const main = document.querySelector('.main-content') as HTMLElement | null + if (main) { + main.scrollTop += e.deltaY + e.preventDefault() + } + } + } + return ( -