Describe the problem
sveltekit's onNavigate doesn't run for shallow routing as these aren't truly navigations. This means if you want to use a view transition for a shallow route you need to modify the code wherever pushState/replaceState is ran using the lower level tick function. This is a bit messy.
Describe the proposed solution
maybe onNavigate can optionally support shallow routing as well with an optional boolean property before the callback?
// I want my callback to run for shallow routing
onNavigate(true, async () => {
// boilerplate view transition code
})
// the default behaviour would still be possible by not providing this argument or by specifying false
Alternatives considered
A separate function, onShallowNavigate or similar.
Importance
nice to have
Additional Information
No response
Describe the problem
sveltekit's
onNavigatedoesn't run for shallow routing as these aren't truly navigations. This means if you want to use a view transition for a shallow route you need to modify the code wherever pushState/replaceState is ran using the lower level tick function. This is a bit messy.Describe the proposed solution
maybe onNavigate can optionally support shallow routing as well with an optional boolean property before the callback?
Alternatives considered
A separate function,
onShallowNavigateor similar.Importance
nice to have
Additional Information
No response