Skip to content

Commit f53c228

Browse files
committed
fixed z-index popup bug
1 parent a3aaa89 commit f53c228

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/components/layout/Main/Desktop/FilterMenu.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ const useStyles = makeStyles(theme => ({
3131
borderTopRightRadius: theme.borderRadius.md,
3232
borderBottomLeftRadius: theme.borderRadius.md,
3333
borderBottomRightRadius: theme.borderRadius.md,
34+
position: 'absolute',
35+
zIndex: 2,
3436
},
3537
header: {
3638
// color: theme.palette.text.cyan,

src/features/Map/Map.jsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -422,12 +422,17 @@ class Map extends React.Component {
422422
});
423423
};
424424

425+
//Service Request Details Popup
425426
addPopup = (coordinates, requestId) => {
426427
this.setState({ selectedRequestId: requestId });
427428
this.popup = new mapboxgl.Popup({closeButton: false, anchor: 'left'})
428429
.setLngLat(coordinates)
429430
.setDOMContent(this.requestDetail)
430431
.addTo(this.map);
432+
433+
if (this.popup.getElement()) {
434+
this.popup.getElement().style.zIndex = '2';
435+
}
431436
};
432437

433438
removePopup = () => {
@@ -792,6 +797,7 @@ class Map extends React.Component {
792797
return;
793798
}
794799

800+
//NC Name Tooltip Popup
795801
this.ncPopup = new mapboxgl.Popup({
796802
closeButton: false,
797803
closeOnClick: false,
@@ -800,11 +806,8 @@ class Map extends React.Component {
800806
.setHTML(`<div>${ncName}</div>`)
801807
.addTo(this.map);
802808

803-
// Not sure if needed in the future:
804-
// A z-index below 0 will have the popup appear underneath the map and therefore be invisible
805-
// This popup still currently appears on top of the DatePicker and RequestDetail modal
806809
if (this.ncPopup.getElement()) {
807-
this.ncPopup.getElement().style.zIndex = '0';
810+
this.ncPopup.getElement().style.zIndex = '1';
808811
}
809812

810813
};

0 commit comments

Comments
 (0)