Start every page at the top
Build and Push Docker Image / build-and-push (push) Successful in 4m27s

The scroll position of the previous page used to carry over, which on iPad makes the
system blur the app bar when content is scrolled under it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nmemmertandClaude Sonnet 5.5 committed 2026-09-29 11:32:26 -04:00
1 parent 7fc5e4b534
commit bb7b5bd6d8
2 files changed
+22

No files matched your search

+16
View File
@@ -1420,3 +1420,19 @@ describe('System chrome follows the theme', () => {
expect(document.documentElement.style.colorScheme).toBe('light');
});
});
describe('New pages start at the top', () => {
test('moving to another page resets the scroll position', async () => {
const user = userEvent.setup();
await renderApp();
const scroller = document.scrollingElement ?? document.documentElement;
scroller.scrollTop = 480; // scrolled down on the dashboard
await user.click(screen.getByRole('button', { name: /reading plans/i }));
await screen.findByRole('heading', { name: /^reading plans$/i });
expect(scroller.scrollTop).toBe(0);
scroller.scrollTop = 300;
await user.click(screen.getByRole('button', { name: /back to home/i }));
await screen.findByText('My Studies');
expect(scroller.scrollTop).toBe(0);
});
});