Skip to content

Commit cb4fc72

Browse files
committed
fix: incorrect leaderboard width in canvas (#8597)
1 parent 1c994e5 commit cb4fc72

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

web-common/src/features/canvas/components/leaderboard/LeaderboardDisplay.svelte

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,13 @@
163163
class="grid-wrapper gap-px overflow-x-auto"
164164
style:grid-template-columns="repeat(auto-fit, minmax({estimatedTableWidth +
165165
LEADERBOARD_WRAPPER_PADDING}px, 1fr))"
166-
bind:clientWidth={leaderboardWrapperWidth}
167166
>
168167
{#each visibleDimensions as dimension (dimension.name)}
169168
{#if dimension.name}
170-
<div class="leaderboard-wrapper">
169+
<div
170+
class="leaderboard-wrapper"
171+
bind:clientWidth={leaderboardWrapperWidth}
172+
>
171173
<Leaderboard
172174
leaderboardShowContextForAllMeasures
173175
timeControlsReady

web-common/src/features/canvas/components/leaderboard/util.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import { MEASURES_PADDING } from "@rilldata/web-common/features/dashboards/leaderboard/leaderboard-widths.ts";
2+
13
export const MIN_DIMENSION_COLUMN_WIDTH = 150;
24
export const DEFAULT_DIMENSION_COLUMN_WIDTH = 164;
3-
export const LEADERBOARD_WRAPPER_PADDING = 56;
5+
export const LEADERBOARD_WRAPPER_PADDING = 56 + MEASURES_PADDING;
46

57
export function getDimensionColumnWidth(
68
wrapperWidth: number,

0 commit comments

Comments
 (0)