Skip to content

Commit 88e6905

Browse files
[spark-compete] enhance(smooth): scrolled anchor links never update the URL bar
1 parent 5245650 commit 88e6905

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

app.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,9 @@
10111011
if (!target) return;
10121012
e.preventDefault();
10131013
target.scrollIntoView({ behavior: reduced ? 'auto' : 'smooth', block: 'start' });
1014+
if (window.history && typeof window.history.replaceState === 'function') {
1015+
window.history.replaceState(null, '', href);
1016+
}
10141017
});
10151018
});
10161019

0 commit comments

Comments
 (0)