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

turbo:visit is dispatched twice on redirect #877

Open
domchristie opened this issue Feb 20, 2023 · 1 comment
Open

turbo:visit is dispatched twice on redirect #877

domchristie opened this issue Feb 20, 2023 · 1 comment

Comments

@domchristie
Copy link
Contributor

With the following flow:

  1. User clicks link to /one
  2. turbo:visit is fired
  3. /one redirects to /two
  4. turbo:visit is fired again

There's currently no way to accurately determine whether a Visit was triggered by a click, a redirect, or programmatically via Turbo.visit. This is useful for animating page transitions: an animation library could animate on the first turbo:visit, and ignore the redirect visit.

Perhaps it'd be worth detailing the reason in event.details, similar to the reload event?

@morki
Copy link

morki commented Feb 1, 2024

This also causes problems with buitin progressbar, which is jumping wierdly on redirect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants