Skip to content

Commit 5f5fe84

Browse files
committed
Force refresh of scrollbar when toggling
Fixes #1455
1 parent ca0865b commit 5f5fe84

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/resources/formats/html/templates/quarto-html.ejs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,17 @@ window.document.addEventListener("DOMContentLoaded", function (event) {
8282
}
8383
}
8484
}
85+
86+
// Hack to workaround the fact that safari doesn't
87+
// properly recolor the scrollbar when toggling (#1455)
88+
if (navigator.userAgent.indexOf('Safari') > 0 && navigator.userAgent.indexOf('Chrome') == -1) {
89+
manageTransitions("body", false);
90+
window.scrollTo(0, 1);
91+
setTimeout(() => {
92+
window.scrollTo(0, 0);
93+
manageTransitions("body", true);
94+
}, 40);
95+
}
8596
}
8697
8798
const isFileUrl = () => {

0 commit comments

Comments
 (0)