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

Page transitions don't work if <a> tag has target attribute set (even to '_self') #13162

Open
emmalexandria opened this issue Dec 15, 2024 · 0 comments · May be fixed by #13165
Open

Page transitions don't work if <a> tag has target attribute set (even to '_self') #13162

emmalexandria opened this issue Dec 15, 2024 · 0 comments · May be fixed by #13165
Labels
bug Something isn't working

Comments

@emmalexandria
Copy link

emmalexandria commented Dec 15, 2024

Describe the bug

Page transitions (achieved through a simple setup in +layout.svelte:

{#key data.pathname}
  <main in:fade={{ duration: 100, delay: 200 }} out:fade={{ duration: 100 }}>
    {@render children()}
  </main>
{/key}

will trigger when an <a> tag has no target set, but will not trigger when target is set to anything except undefined (including the default value of _self)

Reproduction

https://github.com/emmalexandria/transitions-repro

Logs

No response

System Info

System:
    OS: macOS 14.5
    CPU: (8) arm64 Apple M2
    Memory: 64.84 MB / 8.00 GB
    Shell: 3.7.1 - /opt/homebrew/bin/fish
  Binaries:
    Node: 23.2.0 - ~/.local/share/nvm/v23.2.0/bin/node
    npm: 10.9.0 - ~/.local/share/nvm/v23.2.0/bin/npm
    pnpm: 9.14.2 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 131.0.6778.140
    Safari: 17.5
  npmPackages:
    @sveltejs/adapter-auto: ^3.0.0 => 3.3.1 
    @sveltejs/adapter-static: ^3.0.6 => 3.0.6 
    @sveltejs/kit: ^2.9.0 => 2.11.1 
    @sveltejs/vite-plugin-svelte: ^5.0.0 => 5.0.2 
    svelte: ^5.0.0 => 5.13.0 
    vite: ^6.0.0 => 6.0.3

Severity

annoyance

Additional Information

In custom link components, this little nit can be worked around by passing undefined to target instead of a default value of _self.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants