From 535b78d0ee66da11efb83f68d5f18bbf573fc618 Mon Sep 17 00:00:00 2001 From: FloPinguin <25036848+FloPinguin@users.noreply.github.com> Date: Sun, 22 Feb 2026 19:34:41 +0100 Subject: [PATCH] style: update query selector from virtualizer-container to scroll-container for consistency --- .../leaderboard/LeaderboardPlayerList.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/client/components/leaderboard/LeaderboardPlayerList.ts b/src/client/components/leaderboard/LeaderboardPlayerList.ts index 8322c0bc5..fcee8f73c 100644 --- a/src/client/components/leaderboard/LeaderboardPlayerList.ts +++ b/src/client/components/leaderboard/LeaderboardPlayerList.ts @@ -22,7 +22,7 @@ export class LeaderboardPlayerList extends LitElement { private currentUserId: string | null = null; private currentUserIdLoaded = false; - @query(".virtualizer-container") private virtualizerContainer?: HTMLElement; + @query(".scroll-container") private scrollContainer?: HTMLElement; createRenderRoot() { return this; @@ -151,12 +151,12 @@ export class LeaderboardPlayerList extends LitElement { return; } - if (!this.virtualizerContainer || !this.isVisible()) { + if (!this.scrollContainer || !this.isVisible()) { this.showStickyUser = false; return; } - const currentRow = this.virtualizerContainer.querySelector( + const currentRow = this.scrollContainer.querySelector( '[data-current-user="true"]', ) as HTMLElement | null; @@ -165,7 +165,7 @@ export class LeaderboardPlayerList extends LitElement { return; } - const containerRect = this.virtualizerContainer.getBoundingClientRect(); + const containerRect = this.scrollContainer.getBoundingClientRect(); const rowRect = currentRow.getBoundingClientRect(); const isVisible = rowRect.top >= containerRect.top && @@ -187,12 +187,12 @@ export class LeaderboardPlayerList extends LitElement { private maybeLoadMorePlayers() { if (this.isLoading || this.isLoadingMore) return; if (!this.playerHasMore || this.error || this.loadMoreError) return; - if (!this.virtualizerContainer || !this.isVisible()) return; + if (!this.scrollContainer || !this.isVisible()) return; const threshold = 64 * 3; - const scrollTop = this.virtualizerContainer.scrollTop; - const containerHeight = this.virtualizerContainer.clientHeight; - const scrollHeight = this.virtualizerContainer.scrollHeight; + const scrollTop = this.scrollContainer.scrollTop; + const containerHeight = this.scrollContainer.clientHeight; + const scrollHeight = this.scrollContainer.scrollHeight; const nearBottom = scrollTop + containerHeight >= scrollHeight - threshold; if (containerHeight === 0 || scrollHeight === 0) return; // guard @@ -245,7 +245,7 @@ export class LeaderboardPlayerList extends LitElement { ? html`