feat: add scroll to DocumentNav when content has overflow (#26885)

* feat: add scroll to DocumentNav when content has overflow

* Update src/components/UI/docs/DocumentNav.tsx

Co-authored-by: Paul Wackerow <54227730+wackerow@users.noreply.github.com>

---------

Co-authored-by: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
This commit is contained in:
Nicolás Quiroz 2023-03-15 10:58:41 -03:00 committed by GitHub
parent e3ba8526f7
commit 585658d080
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -20,7 +20,7 @@ export const DocumentNav: FC<Props> = ({ content }) => {
const activeHash = useActiveHash(parsedHeadings.map(heading => heading!.headingId));
return parsedHeadings.length ? (
<Box as='aside' position='sticky' top='4'>
<Box as='aside' position='sticky' h='calc(100vh - 3rem)' overflowY='auto' top='4'>
<Text textStyle='document-nav-title'>on this page</Text>
<Divider borderColor='primary' my={`4 !important`} />
{parsedHeadings.map((heading, idx) => {