Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make shouldResetScrollPosition work for non-link requests #55

Closed
1 of 3 tasks
daun opened this issue Jun 26, 2023 · 1 comment
Closed
1 of 3 tasks

Make shouldResetScrollPosition work for non-link requests #55

daun opened this issue Jun 26, 2023 · 1 comment

Comments

@daun
Copy link
Member

daun commented Jun 26, 2023

  • 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
@daun
Copy link
Member Author

daun commented Jun 26, 2023

Just realized this is completely obsolete in swup 4 — we can just set context.scroll.reset to false in the transitionStart hook.

@daun daun closed this as completed Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant