Skip to content

Commit ff34139

Browse files
authored
Fix flickering header drop shadow (#884)
On iOS Safari, headerTop can sometimes be negative when scrolling and the comparison to 0 is no longer true, which removes the drop shadow and causes the flickering. Remove the comparison with the header position to avoid DOM layout reads and fix the flickering by not comparing to exactly 0.
1 parent 71a6bff commit ff34139

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/furo/assets/scripts/furo.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ var lastScrollTop = document.documentElement.scrollTop;
99
const GO_TO_TOP_OFFSET = 64;
1010

1111
function scrollHandlerForHeader(positionY) {
12-
const headerTop = Math.floor(header.getBoundingClientRect().top);
13-
14-
if (headerTop == 0 && positionY != headerTop) {
12+
if (positionY > 0) {
1513
header.classList.add("scrolled");
1614
} else {
1715
header.classList.remove("scrolled");

0 commit comments

Comments
 (0)