sponsorship: Don't preserve scroll position on reload.

This commit is contained in:
Aman Agrawal 2023-11-12 10:20:13 +00:00 committed by Tim Abbott
parent 395cafcf46
commit 1b804cd0dd
1 changed files with 9 additions and 0 deletions

View File

@ -97,5 +97,14 @@ export function initialize(): void {
}
$(() => {
// Don't preserve scroll position on reload. This allows us to
// show the sponsorship pending message after user submits the
// form otherwise the sponsorship pending message is partially
// hidden due to browser preserving scroll position.
// https://developer.mozilla.org/en-US/docs/Web/API/History/scrollRestoration
if (history.scrollRestoration) {
history.scrollRestoration = "manual";
}
initialize();
});