`afterNavigate` gets called on previous page if it has a global transition
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
Normally from navigating from page A to page B the callback flow is the following:
- A -
beforeNavigate - A -
onNavigate - B -
afterNavigate
But, when page A has a component with transition|global, it's afterNavigate is also called. I think this is a bug, or should at least be documented.
Related: #12545
Reproduction
https://www.sveltelab.dev/kgvookzyzs3eb87
Severity
annoyance
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 by running the linked SvelteLab reproduction and compare navigation from a page with a global transition against the documented callback order. Trace the navigation and transition lifecycle to determine why the previous page receives afterNavigate, then verify that only the destination page does and that the existing callback sequence remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100