Skip to content

Commit ac5af9d

Browse files
committed
fix(viewer): make viewer header sticky
1 parent 88abfb3 commit ac5af9d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/components/viewers/stop-viewer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import LocationIcon from '../icons/location-icon'
1212
import { setMainPanelContent, toggleAutoRefresh } from '../../actions/ui'
1313
import { findStop, findStopTimesForStop } from '../../actions/api'
1414
import { forgetStop, rememberStop, setLocation } from '../../actions/map'
15-
import { formatDuration, formatStopTime } from '../../util/time'
1615
import { routeComparator } from '../../util/itinerary'
16+
import { formatDuration, formatStopTime } from '../../util/time'
1717

1818
class StopViewer extends Component {
1919
state = {}

lib/components/viewers/viewers.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
.otp .stop-viewer-header, .otp .trip-viewer-header, .otp .route-viewer-header {
44
background-color: #ddd;
55
padding: 12px;
6+
position: sticky; /* Ensure header bar sticks to top of scrolling div */
7+
top: 0px;
8+
z-index: 1; /* Ensure sticky header stays on top of viewer body */
69
}
710

811
.otp .stop-viewer-body, .otp .trip-viewer-body {

0 commit comments

Comments
 (0)