Make `shouldResetScrollPosition` work for non-link requests
daun opened this issue · comments
Philipp Daun commented
- Currently,
shouldResetScrollPosition
passes in a link element - We should make sure this still works for form requests or API requests
- The API of
ignoreVisit
probably makes sense to emulate here
options = {
shouldResetScrollPosition: (url: string, { el, event }: { el?: Element; event?: Event }) => boolean
}
How important is this feature to you?
- Nice to have
- Would make my life a lot easier
- I cannot use swup without it
Philipp Daun commented
Just realized this is completely obsolete in swup 4 — we can just set context.scroll.reset
to false
in the transitionStart
hook.