Skip to content

Commit 354e3f0

Browse files
authored
DBC22-5493: Adjusting scroll for sidepanels at draggable breakpoints (#1241)
1 parent e52cb99 commit 354e3f0

5 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/frontend/src/Components/map/Map.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,11 @@ export default function DriveBCMap(props) {
10991099

11001100
<Drawer.Portal container={mapElement.current}>
11011101
<Drawer.Overlay className="drawer-overlay" />
1102-
<Drawer.Content className="drawer-content" ref={drawerRef}>
1102+
<Drawer.Content
1103+
className="drawer-content"
1104+
ref={drawerRef}
1105+
style={{ '--drawer-snap-point': snap }}
1106+
>
11031107
{clickedFeature &&
11041108
<button
11051109
className="close-panel"

src/frontend/src/Components/map/Map.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@
497497

498498
.popup__content {
499499
overflow-y: scroll;
500+
height: calc(var(--drawer-snap-point, 100%) - 52px);
500501
}
501502
}
502503

src/frontend/src/Components/map/panels/index.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@
55
height: 100%;
66
margin-bottom: 0;
77

8-
@supports (-webkit-touch-callout: none) {
9-
@media (max-width: 430px) {
10-
margin-bottom: 270px;
11-
}
12-
}
13-
148
&__title {
159
padding: 1rem 4rem 0.75rem 1rem;
1610
height: 52px;

src/frontend/src/Components/map/panels/weather/LocalWeatherPanel.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,11 @@ export default function LocalWeatherPanel(props) {
252252
</div>
253253
)}
254254

255-
<div className="popup__content__forecasts">
256-
<LocalForecastTabs forecasts={dailyForecastData} />
257-
</div>
255+
{dailyForecastData.length > 0 && (
256+
<div className="popup__content__forecasts">
257+
<LocalForecastTabs forecasts={dailyForecastData} />
258+
</div>
259+
)}
258260
</div>
259261

260262
<div className="popup__content__footer">

src/frontend/src/Components/map/panels/weather/LocalWeatherPanel.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@
9999
}
100100

101101
&__footer {
102-
padding: 1rem;
103102
margin-top: auto;
104103

105104
p {

0 commit comments

Comments
 (0)