Skip to content

Commit 653c3cb

Browse files
authored
fix(toc): display scroll bar only if the content is overflowing (#1185)
The `table-of-content` component shows a scrollbar on Windows even if the content fits: ![image](https://github.com/npm/documentation/assets/1770529/7bfcb577-0563-40a5-98f4-d4b68d3d2b45) This fix enables `auto` mode to display scroll bar only if the content is overflowing: ![image](https://github.com/npm/documentation/assets/1770529/81e6743b-e1cc-4013-a0e7-069233777c11) ![image](https://github.com/npm/documentation/assets/1770529/d327d725-e4eb-4472-9d1b-a3a311cbf260)
1 parent eeb73d0 commit 653c3cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/table-of-contents.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export const Desktop = withTableOfContents(({items}) => (
8383
sx={{
8484
// extra pixels to account for table of contents title height
8585
maxHeight: `calc(100% - 24px)`,
86-
overflowY: 'scroll',
86+
overflowY: 'auto',
8787
}}
8888
>
8989
<TableOfContents aria-labelledby="toc-heading" items={items} sx={{ml: -2}} />

0 commit comments

Comments
 (0)