Skip to content

Commit d08c5de

Browse files
author
Lio Schimanko
committed
fix(css): prevent WebKit autoscroll bug on page hydration
1 parent 8cf81d7 commit d08c5de

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎src/frame/stylesheets/index.scss‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,13 @@
2222

2323
// For primer Spinners and other animated components
2424
@import "@primer/primitives/dist/css/base/motion/motion.css";
25+
26+
/* Prevent WebKit smooth-scroll hydration bug on page load */
27+
html {
28+
scroll-behavior: auto !important;
29+
}
30+
31+
/* Enable smooth scrolling only when user explicitly clicks an anchor link */
32+
html:focus-within {
33+
scroll-behavior: smooth;
34+
}

0 commit comments

Comments
 (0)