Scroll to page title on step navigation instead of wizard body
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f6f4853ab6
commit
e49efb7207
1 changed files with 3 additions and 2 deletions
|
|
@ -390,8 +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" });
|
||||
// Scroll to page title (above the wizard)
|
||||
const pageTitle = document.querySelector("main h1, .pw-order-intro h1");
|
||||
(pageTitle || wizard).scrollIntoView({ behavior: "smooth", block: "start" });
|
||||
|
||||
// Let the active step hydrate itself
|
||||
window.dispatchEvent(new CustomEvent("pw:step-shown", {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue