daisyui icon indicating copy to clipboard operation
daisyui copied to clipboard

docs: Firefox - Switching between pages scroll does not reset to top

Open AiAe opened this issue 10 months ago โ€ข 4 comments

On which page do you see this issue?

https://daisyui.com/docs/themes/

Describe the issue

Scroll to the bottom of https://daisyui.com/docs/themes/ then click on Base Style

From my tests this appears to be only issue on Firefox (135.0.1)

There is no errors in console either.

What browsers are you seeing the problem on?

Firefox

AiAe avatar Mar 01 '25 12:03 AiAe

Thank you @AiAe for reporting issues. It helps daisyUI a lot ๐Ÿ’š
I'll be working on issues one by one. I will help with this one as soon as a I find a solution.
In the meantime providing more details and reproduction links would be helpful.

github-actions[bot] avatar Mar 01 '25 12:03 github-actions[bot]

This is not an issue only in the Base Style but it depends on the source page scrolled position and the destination page maximum scroll depth. This appears to be a known Firefox-specific issue with scroll position restoration when navigating between pages of differing heights. As documented in https://github.com/swup/swup/issues/95, Firefox sets the scroll position before content replacement, which causes problems specifically when navigating from a longer page (where you've scrolled down significantly) to a shorter page.

@saadeghi I've tried several approaches without success:

  1. Adding window.scrollTo(0, 0) in onNavigate handler
  2. Using afterNavigate with setTimeout to force scroll reset

also check this out: https://lightrun.com/answers/sveltejs-kit-page-scroll-position-not-reset-to-top-on-navigation-regression

sulimanbenhalim avatar May 01 '25 16:05 sulimanbenhalim

FWIW, I came here to report this issue. I noticed this because I had read all the way to the bottom of the Introduction page and then clicked the Install page and noticed I had not scrolled to the top.

I'm also using Firefox.

rsyring avatar Jul 23 '25 00:07 rsyring

(firefox) this also happens in here https://daisyui.com/docs/install/ while looking into different pages

codayon avatar Nov 07 '25 18:11 codayon