Skip to content

Commit 4066696

Browse files
committed
fix: bring user back to the hiring form when hire button is pressed
1 parent 4df4760 commit 4066696

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

assets/js/app.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,13 @@ const Hooks = {
616616
});
617617
},
618618
},
619+
ScrollToTop: {
620+
mounted() {
621+
this.el.addEventListener("click", () => {
622+
window.scrollTo({ top: 0, behavior: "smooth" });
623+
});
624+
},
625+
},
619626
} satisfies Record<string, Partial<ViewHook> & Record<string, unknown>>;
620627

621628
// Accessible focus handling

lib/algora_web/live/home_live.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,8 @@ defmodule AlgoraWeb.HomeLive do
348348
</h2>
349349
<div class="mt-6 sm:mt-10 flex gap-4 justify-center">
350350
<.button
351-
navigate={~p"/onboarding/org"}
351+
id="start-hiring-button"
352+
phx-hook="ScrollToTop"
352353
class="h-10 sm:h-14 rounded-md px-8 sm:px-12 text-sm sm:text-xl"
353354
>
354355
Start hiring

0 commit comments

Comments
 (0)