aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/components/ParksTable.astro
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/ParksTable.astro')
-rw-r--r--src/components/ParksTable.astro4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/components/ParksTable.astro b/src/components/ParksTable.astro
index 2141eac..4918b2c 100644
--- a/src/components/ParksTable.astro
+++ b/src/components/ParksTable.astro
@@ -779,9 +779,11 @@ function isUnconfirmed(p: Park): boolean {
const scrollRowIntoView = (row: HTMLElement) => {
const scroller = root.querySelector<HTMLElement>(".parks-scroll");
if (!scroller) return;
+ const thead = scroller.querySelector("thead");
+ const headH = thead ? thead.getBoundingClientRect().height : 0;
const rowRect = row.getBoundingClientRect();
const scRect = scroller.getBoundingClientRect();
- const delta = rowRect.top - scRect.top - scRect.height / 2 + rowRect.height / 2;
+ const delta = rowRect.top - scRect.top - headH - 2;
scroller.scrollTo({ top: scroller.scrollTop + delta, behavior: "smooth" });
};