fix clipped tooltips on controls bar (#8791)

* controls: add wrapper div to not clip tooltips

* bind wheel to controlsWrap
minor z-index change

* scrollbar for ie/firefox

Co-authored-by: Milos Brzakovic (E-Search) <mbrzakovic@microsoft.com>
This commit is contained in:
Martin Raifer
2021-11-05 11:41:23 +01:00
committed by GitHub
parent 3e7fd6e033
commit a30856eb83
2 changed files with 23 additions and 9 deletions

View File

@@ -2953,22 +2953,32 @@ img.tag-reference-wiki-image {
/* Map Controls
------------------------------------------------------- */
.map-controls-wrap {
position: absolute;
left: 0;
right: 0;
height: 100%;
z-index: 100;
display: block;
overflow-x: hidden;
overflow-y: auto;
pointer-events: none;
-ms-overflow-style: none;
scrollbar-width: none;
}
.map-controls-wrap::-webkit-scrollbar {
display: none;
}
.map-controls {
right: 0;
top: 0;
width: 40px;
position: absolute;
z-index: 100;
bottom: 0;
display: flex;
flex-direction: column;
padding: 5px 0;
pointer-events: none;
overflow-x: hidden;
overflow-y: auto;
}
.map-controls::-webkit-scrollbar {
display: none;
}
.map-controls:before {
content: '';

View File

@@ -182,7 +182,11 @@ export function uiInit(context) {
.call(uiSpinner(context));
// Map controls
var controls = overMap
var controlsWrap = overMap
.append('div')
.attr('class', 'map-controls-wrap');
var controls = controlsWrap
.append('div')
.attr('class', 'map-controls');
@@ -201,9 +205,9 @@ export function uiInit(context) {
.attr('class', 'map-control geolocate-control')
.call(uiGeolocate(context));
controls.on('wheel.mapControls', function(d3_event) {
controlsWrap.on('wheel.mapControls', function(d3_event) {
if (!d3_event.deltaX) {
controls.node().scrollTop += d3_event.deltaY;
controlsWrap.node().scrollTop += d3_event.deltaY;
}
});