diff --git a/src/components/FranceMap.astro b/src/components/FranceMap.astro index c81ae33..72dcacc 100644 --- a/src/components/FranceMap.astro +++ b/src/components/FranceMap.astro @@ -193,9 +193,18 @@ for (const [code] of entries) { tooltip.dataset.code = t.getAttribute('data-code'); const rect = t.getBoundingClientRect(); show(t, { clientX: rect.left + rect.width / 2, clientY: rect.top }); - setTimeout(function () { tooltip.dataset.code = ''; }, 3000); } } }, { passive: false }); + + // Fermer le tooltip si on tape ailleurs (mobile : pas de mouseout). + document.addEventListener('pointerdown', function (e) { + const t = e.target; + const onPath = t && t.tagName === 'path' && t.getAttribute('data-code'); + if (!onPath) { + tooltip.dataset.code = ''; + hide(); + } + }); })();