From 404cea44e37e999cd11718c8736950e54b9a0f73 Mon Sep 17 00:00:00 2001 From: ReiMerc Date: Wed, 8 Feb 2023 12:18:48 +0100 Subject: [PATCH] Fix dot when scrolling --- frontend/src/main.ts | 4 ++-- frontend/style.css | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/main.ts b/frontend/src/main.ts index 930a32b..479cce7 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -69,8 +69,8 @@ function displayZipCode( const position = convertCoordinateToPixels(center, mapSize); const rect = document.getElementById("map")!.getBoundingClientRect(); dot.style.display = "block"; - dot.style.left = (position.x + rect.left) + "px"; - dot.style.top = (position.y + rect.top) + "px"; + dot.style.left = position.x + rect.left + "px"; + dot.style.top = position.y + rect.top + document.documentElement.scrollTop + "px"; } function setupMap( diff --git a/frontend/style.css b/frontend/style.css index 510377c..6358dbe 100644 --- a/frontend/style.css +++ b/frontend/style.css @@ -187,7 +187,7 @@ code { border: 2px solid black; background-color: var(--brand); filter: drop-shadow(1px 1px 2px black); - position: fixed; + position: absolute; display: none; }