Skip to content

Fix flickering header drop shadow#884

Merged
pradyunsg merged 1 commit into
pradyunsg:mainfrom
holesch:fix-header-drop-shadow
Jul 18, 2025
Merged

Fix flickering header drop shadow#884
pradyunsg merged 1 commit into
pradyunsg:mainfrom
holesch:fix-header-drop-shadow

Conversation

@holesch

@holesch holesch commented Jul 6, 2025

Copy link
Copy Markdown
Contributor

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.

The flickering issue was discussed in #415. This was then linked to #681, but I couldn't reproduce the issue with the "Back to Top" button.

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.
@pradyunsg

Copy link
Copy Markdown
Owner

Whee, thanks @holesch! ^.^

@pradyunsg pradyunsg merged commit ff34139 into pradyunsg:main Jul 18, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants