Scroll to top of wizard on Next/Back step navigation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
justin 2026-04-29 01:29:32 -05:00
parent 27108b9080
commit f6f4853ab6

View file

@ -390,6 +390,9 @@ const STEP_LABELS: Record<string, string> = {
(document.getElementById("pw-back") as HTMLButtonElement).disabled = idx === 0;
const nextBtn = document.getElementById("pw-next") as HTMLButtonElement;
nextBtn.textContent = idx === steps.length - 1 ? "Finish" : "Next →";
// Scroll to top of wizard
wizard.scrollIntoView({ behavior: "smooth", block: "start" });
// Let the active step hydrate itself
window.dispatchEvent(new CustomEvent("pw:step-shown", {
detail: { step: steps[idx], idx },