Skip to content

Commit

Permalink
Disconnect sidebar scroll behaviors (#5778)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored Mar 20, 2023
1 parent a77fa55 commit 1926e48
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/components/Layout/SidebarNav/SidebarNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,15 @@ export default function SidebarNav({
}

return (
<div className={cn('sticky top-0 lg:bottom-0 lg:h-screen flex flex-col')}>
<div className="overflow-y-scroll no-bg-scrollbar lg:w-[342px] grow bg-wash dark:bg-wash-dark">
<div
className={cn(
'sticky top-0 lg:bottom-0 lg:h-[calc(100vh-4rem)] flex flex-col'
)}>
<div
className="overflow-y-scroll no-bg-scrollbar lg:w-[342px] grow bg-wash dark:bg-wash-dark"
style={{
overscrollBehavior: 'contain',
}}>
<aside
className={cn(
`lg:grow lg:flex flex-col w-full pb-8 lg:pb-0 lg:max-w-xs z-10 hidden lg:block`
Expand Down
6 changes: 5 additions & 1 deletion src/components/Layout/Toc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ export function Toc({headings}: {headings: Toc}) {
On this page
</h2>
)}
<div className="h-full overflow-y-auto pl-4 max-h-[calc(100vh-7.5rem)]">
<div
className="h-full overflow-y-auto pl-4 max-h-[calc(100vh-7.5rem)]"
style={{
overscrollBehavior: 'contain',
}}>
<ul className="space-y-2 pb-16">
{headings.length > 0 &&
headings.map((h, i) => {
Expand Down

0 comments on commit 1926e48

Please sign in to comment.