Skip to content

Commit 76c539e

Browse files
committed
fixup! fix: sidebar scrolling on mobile devices
1 parent 4b1f255 commit 76c539e

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

src/courseware/course/sidebar/sidebars/course-outline/CourseOutlineTray.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const CourseOutlineTray = () => {
8484
return (
8585
<div className={classNames('outline-sidebar-wrapper', {
8686
'flex-shrink-0 mr-4 h-auto': !shouldDisplayFullScreen,
87-
'bg-white m-0 fixed-top w-100 vh-100': shouldDisplayFullScreen,
87+
'bg-white m-0 fixed-top w-100': shouldDisplayFullScreen,
8888
})}
8989
>
9090
<section className="outline-sidebar w-100">
@@ -100,7 +100,7 @@ const CourseOutlineTray = () => {
100100
return (
101101
<div className={classNames('outline-sidebar-wrapper', {
102102
'flex-shrink-0 mr-4 h-auto': !shouldDisplayFullScreen,
103-
'bg-white m-0 fixed-top w-100 vh-100': shouldDisplayFullScreen,
103+
'bg-white m-0 fixed-top w-100': shouldDisplayFullScreen,
104104
})}
105105
>
106106
<section className="outline-sidebar w-100">

src/courseware/course/sidebar/sidebars/course-outline/CourseOutlineTray.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@
99
position: relative;
1010
}
1111

12-
// The fixed, full-height overlay needs its own scroll context.
12+
// The fixed, full-height overlay needs its own scroll context. Height is owned
13+
// here instead of Bootstrap's `vh-100`: iOS Safari resolves `100vh` to the large
14+
// viewport (URL bar hidden), hiding the bottom of a long outline behind the bar.
15+
// `100dvh` tracks the visible height; `100vh` is the fallback for older engines.
1316
&.fixed-top {
17+
height: 100vh;
18+
height: 100dvh;
1419
overflow-y: auto;
1520
}
1621
}

0 commit comments

Comments
 (0)