Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions e2e/tests/season-schedule.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,30 @@ test.describe("Season schedules", () => {
await expect(page.getByRole("tab", { name: "Stats" })).toBeVisible();
});

test("scrolls the page over expanded desktop momentum stats", async ({ page }) => {
await page.setViewportSize({ width: 1440, height: 900 });
await page.goto("/");
await page.getByTestId("live-dashboard-game-401873297").click();
const panel = page.getByTestId("game-stats-panel");
await panel.getByRole("tab", { name: "Momentum" }).click();
const content = panel.getByRole("tabpanel");
await expect(content.getByText("Win Probability Over Time")).toBeVisible();
const sidebar = page.getByTestId("schedule-sidebar");
// Hovering the whole tall panel can scroll Firefox to the document bottom.
// Position its top within the viewport, leaving room to wheel downward.
await content.evaluate((element) => {
window.scrollTo(0, element.getBoundingClientRect().top + window.scrollY - 600);
});
const contentBox = await content.boundingBox();
await page.mouse.move(contentBox!.x + 20, contentBox!.y + 20);
const before = await page.evaluate(() => window.scrollY);
await page.mouse.wheel(0, 500);
await expect.poll(() => page.evaluate(() => window.scrollY)).toBeGreaterThan(before);
await expect.poll(async () => (await sidebar.boundingBox())!.y).toBeGreaterThanOrEqual(23);
await page.mouse.wheel(0, -500);
await expect.poll(() => page.evaluate(() => window.scrollY)).toBeLessThanOrEqual(before);
});

test("keeps the field visible between drives on wide screens", async ({ page }) => {
await page.unroute("**/api/game-stats/**");
await page.route("**/api/game-stats/**", async (route) => {
Expand Down
8 changes: 4 additions & 4 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,14 @@
@apply border-border outline-ring/50;
}
html {
/* Prevent horizontal scroll and overscroll bounce on mobile */
overflow-x: hidden;
/* Clip horizontal overflow without creating a scroll container that breaks sticky layout. */
overflow-x: clip;
overscroll-behavior-x: none;
}
body {
@apply bg-background text-foreground;
/* Prevent horizontal scroll and overscroll bounce on mobile */
overflow-x: hidden;
/* Clip horizontal overflow without creating a scroll container that breaks sticky layout. */
overflow-x: clip;
overscroll-behavior-x: none;
/* Prevent pull-to-refresh and overscroll effects */
overscroll-behavior-y: contain;
Expand Down
2 changes: 1 addition & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function BracketApp() {
<main
id="main-content"
className={cn(
"min-h-screen overflow-x-hidden bg-black px-3 pt-4 sm:px-4 sm:py-8 md:px-6 md:pt-6 lg:pb-8",
"min-h-screen overflow-x-clip bg-black px-3 pt-4 sm:px-4 sm:py-8 md:px-6 md:pt-6 lg:pb-8",
showBracket && viewMode === "bracket" ? "pb-28 md:pb-32" : "pb-10 md:pb-12",
!isPostseason && "xl:py-6",
)}
Expand Down
4 changes: 2 additions & 2 deletions src/components/dialogs/GameStatsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,8 @@ export function GameStatsDialog({
id={`tabpanel-${activeTab}`}
aria-labelledby={`tab-${activeTab}`}
className={cn(
"overflow-y-auto overscroll-contain px-4 py-4 md:px-6 md:py-5",
variant === "dialog" ? "min-h-0 flex-1" : "max-h-[calc(90vh-180px)]",
"px-4 py-4 md:px-6 md:py-5",
variant === "dialog" && "min-h-0 flex-1 overflow-y-auto overscroll-contain",
)}
>
{isLoading && !stats ? (
Expand Down
Loading