From 860e4752194f831cff90f9202e3a341921664b67 Mon Sep 17 00:00:00 2001 From: David Larlet Date: Fri, 27 Oct 2023 11:32:03 -0400 Subject: [PATCH] Center the tooltip (arrow) for bottom position --- umap/static/umap/base.css | 1 - umap/static/umap/js/umap.ui.js | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/umap/static/umap/base.css b/umap/static/umap/base.css index 29bcac1d..6b928336 100644 --- a/umap/static/umap/base.css +++ b/umap/static/umap/base.css @@ -792,7 +792,6 @@ input:invalid { pointer-events: none; border-top-color: rgba(30, 30, 30, 0.7); border-width: 11px; - margin-left: calc(-50% + 21px); transform: rotate(180deg); } #umap-tooltip-container.tooltip.tooltip-left:after { diff --git a/umap/static/umap/js/umap.ui.js b/umap/static/umap/js/umap.ui.js index c8e9133c..30386915 100644 --- a/umap/static/umap/js/umap.ui.js +++ b/umap/static/umap/js/umap.ui.js @@ -185,8 +185,8 @@ L.U.UI = L.Evented.extend({ this._tooltip.className = 'tooltip-bottom' const coords = this.getPosition(el) this.setTooltipPosition({ - left: coords.left + 30, - bottom: this.getDocHeight() - coords.top - 76, + left: coords.left, + top: coords.bottom + 11, }) },