Skip to content

Commit fdb1c26

Browse files
minORCray-oxd
authored andcommitted
DBC22-6090: Disabling panel resize feature inside the panel to allow only scrolling
1 parent 3ff05bd commit fdb1c26

4 files changed

Lines changed: 18 additions & 4 deletions

File tree

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,13 @@ export default function DriveBCMap(props) {
11311131
</button>
11321132
}
11331133

1134-
<div className="panel-content">
1134+
<div
1135+
className="panel-content"
1136+
onPointerDown={(e) => {
1137+
if (e.target.closest('.popup__content')) {
1138+
e.stopPropagation();
1139+
}
1140+
}}>
11351141
<div className="drawer-drag-handle"></div>
11361142

11371143
{renderPanel(

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@
498498
.popup__content {
499499
overflow-y: scroll;
500500
height: calc(var(--drawer-snap-point, 100%) - 52px);
501+
touch-action: pan-y;
501502
}
502503
}
503504

src/frontend/src/Components/report/ReportMap.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -536,8 +536,8 @@ export function ReportMap(props) {
536536
>
537537
<Drawer.Portal container={mapElement.current}>
538538
<Drawer.Overlay className="drawer-overlay" />
539-
<Drawer.Content
540-
className={`drawer-content ${snap === '80%' ? 'snap-80' : ''}`}
539+
<Drawer.Content
540+
className={`drawer-content ${snap === '80%' ? 'snap-80' : ''}`}
541541
ref={drawerRef}>
542542
<button
543543
className="close-panel"
@@ -550,7 +550,13 @@ export function ReportMap(props) {
550550
}}>
551551
<FontAwesomeIcon icon={faXmark} />
552552
</button>
553-
<div className="panel-content">
553+
<div
554+
className="panel-content"
555+
onPointerDown={(e) => {
556+
if (e.target.closest('.popup__content')) {
557+
e.stopPropagation();
558+
}
559+
}}>
554560
<div className="drawer-drag-handle"></div>
555561
{openPanel && renderPanel()}
556562
</div>

src/frontend/src/Components/report/ReportMap.scss

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

574574
.popup__content {
575575
overflow-y: scroll;
576+
touch-action: pan-y;
576577
}
577578
}
578579

0 commit comments

Comments
 (0)