Preloading fails when link remains hovered after navigation
Nobody has claimed this yet.
- 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.
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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