sveltejs / sveltejs/kit

Preloading fails when link remains hovered after navigation

Open
#14,359 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

router
Dominant language
JavaScript
Stars
20.8k
Forks
2.3k
Avg merge
1d 16h
Merged PRs (30d)
156

Description

Describe the bug

I have a carousel that navigates to the next page on click. When hovered, it preloads the next page as expected. However, if you click and keep the mouse over it, the next page does not preload.

This makes the first navigation of the carousel feel snappy, but the subsequent ones feel sluggish.

Even worse, if you stop hovering and then hover back over it, it still doesn’t preload. It only preloads again if you hover over a different link first and then return.

Image

I can also add a video of the network tab if that would help.

Reproduction

I can’t open Chrome DevTools in WebContainers without the site glitching out, so I’ve also included a repo that can be cloned locally.
https://stackblitz.com/edit/sveltejs-kit-template-default-2plfyu1p?file=src%2Froutes%2Ftest%2F%5Bslug%5D%2F%2Bpage.svelte

https://github.com/Asguho/sveltejs-kit-template-default-akqbnubu

Logs

System Info
"svelte": "^5.25.0"

windows 11, google chrome
Severity

annoyance

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked reproduction in src/routes/test/[slug]/+page.svelte and reproduce the carousel navigation while monitoring the network tab locally. Trace the hover preload behavior across navigation, mouse leave, and mouse re-entry. Done means the next page preloads again after navigation and after leaving and returning to the same link.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.