Skip to content

Commit 8ffcb72

Browse files
authored
docs: fix - make sidebar sticky on desktop (#6351)
* docs: fix - disable overscroll behaviour and make sidebar sticky on desktop * docs: revert overscrolling
1 parent 2062349 commit 8ffcb72

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

docs/src/components/Layout/MainMenu.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ const MainMenu: React.FC<Props> = (props = defaultProps) => {
9494
<Col
9595
{...layout.leftSidebar.width}
9696
xs={props.mobileMode === 'menu' ? 24 : 0}
97+
className={cx(styles.menuWrapperCol)}
9798
>
9899
<div className={cx(styles.menuWrapper, styles.menuWrapperHack)}>
99100
<Menu {...menuProps} className={styles.antMenu}>

docs/static/styles/_layout.scss

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -401,27 +401,34 @@ span.group-header {
401401
}
402402

403403
.menuWrapperHack {
404-
padding-top: 56px !important;
405-
margin-top: -40px;
406404
@media screen and (max-width: 767px) {
405+
height: 100% !important;
406+
position: fixed;
407+
top: 0;
407408
padding-top: 70px !important;
408409
margin-top: 0;
409410
}
410411
}
411412

413+
.menuWrapperCol {
414+
position: sticky;
415+
top: 64px;
416+
}
417+
412418
.menuWrapper {
413-
height: 100%;
414-
width: inherit;
419+
// height: 100%;
420+
height: calc(100vh - 64px);
421+
width: 100%;
415422
background: $sidebar-bg;
416-
padding: 16px 24px;
423+
padding: 16px 24px 24px;
417424
overflow-y: auto;
418425
overflow-x: hidden;
419-
position: fixed;
426+
// position: fixed;
420427
//padding-left: calc(9999px + 24px);
421428
//padding-right: 24px;
422429
//margin-left: -9999px;
423430
//min-width: 245px;
424-
max-height: calc(100% - 66px);
431+
// max-height: calc(100% - 66px);
425432
//background: $light;
426433

427434
@media screen and (max-width: 767px) {

0 commit comments

Comments
 (0)