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

A way to disable prefetch with ViewTransitions #8926

Closed
1 task done
fuwaneko opened this issue Oct 26, 2023 · 3 comments · Fixed by #8951
Closed
1 task done

A way to disable prefetch with ViewTransitions #8926

fuwaneko opened this issue Oct 26, 2023 · 3 comments · Fixed by #8951
Labels
- P2: nice to have Not breaking anything but nice to have (priority) feat: view transitions Related to the View Transitions feature (scope)

Comments

@fuwaneko
Copy link

Astro Info

Astro                    v3.4.0
Node                     v20.8.0
System                   macOS (arm64)
Package Manager          pnpm
Output                   server
Adapter                  @astrojs/node
Integrations             @astrojs/tailwind
                         @astrojs/solid-js

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

I have an app with cookie-based authentication and a sign-out link. When ViewTransitions are enabled, hovering over the sign-out link causes the sign-out per se. There should be a way to tell Astro to disable prefetch on some links, adding "data-astro-reload" to a link doesn't prevent prefetching.

What's the expected result?

A data attribute to disable prefetch, perhaps?

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-hmcjqs

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Oct 26, 2023
@matthewp matthewp added feat: view transitions Related to the View Transitions feature (scope) - P2: nice to have Not breaking anything but nice to have (priority) and removed needs triage Issue needs to be triaged labels Oct 26, 2023
@matthewp
Copy link
Contributor

We are in the process of updating prefetch usage in general and plan to have a solution for this as part of it.

@matthewp
Copy link
Contributor

An alternative is to use a <form> with a POST request. Usually you don't do mutations inside of a GET.

@bis0072
Copy link

bis0072 commented Oct 28, 2023

I'm having the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P2: nice to have Not breaking anything but nice to have (priority) feat: view transitions Related to the View Transitions feature (scope)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants