Skip to content

Commit

Permalink
feat: Scroll to top when opening signup page
Browse files Browse the repository at this point in the history
Closes #457
  • Loading branch information
IiroP committed Oct 26, 2024
1 parent 47861b4 commit f449e0f
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ function Form({
!!event.registrationEndDate &&
new Date(event.registrationEndDate) < new Date();

// On first render, scroll to top
useEffect(() => {
window.scrollTo({ top: 0, behavior: "instant" });
}, []);

useEffect(() => {
const errorFields = state?.errors
? Object.keys(state.errors).filter((v) => v !== "_form")
Expand Down

0 comments on commit f449e0f

Please sign in to comment.