Skip to content

Global transitions trigger incorrectly when containing svelte:element #15887

Open
@tylermcrobert

Description

@tylermcrobert

Describe the bug

When a node is using transition:fade|global, the node should not animate in on mount when refreshing the page. However, if it has a child that is using svelte:element, it incorrectly does.

Reproduction

This will work when downloaded

<script>
  import { fade } from "svelte/transition";

  let key = $state(false);
</script>

{#key key}
  <div transition:fade|global>
    <div>Fades</div>
    <!-- <svelte:element this={"p"}>Uncomment this to see bug</svelte:element> -->
  </div>
{/key}

<button onclick={() => (key = !key)}>Toggle to Fade</button>

Logs

System Info

System:
    OS: macOS 15.3.2
    CPU: (12) arm64 Apple M2 Pro
    Memory: 109.17 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.18.3 - /opt/homebrew/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.8.2 - /opt/homebrew/bin/npm
    pnpm: 8.7.6 - /usr/local/bin/pnpm
  Managers:
    Homebrew: 4.4.22 - /opt/homebrew/bin/brew
    pip3: 24.2 - /Library/Frameworks/Python.framework/Versions/3.12/bin/pip3
    RubyGems: 3.0.3.1 - /usr/bin/gem
  Utilities:
    Make: 3.81 - /usr/bin/make
    GCC: 16.0.0 - /usr/bin/gcc
    Git: 2.15.0 - /usr/local/bin/git
    Clang: 16.0.0 - /usr/bin/clang
    FFmpeg: 7.1 - /opt/homebrew/bin/ffmpeg
    Curl: 8.7.1 - /usr/bin/curl
    OpenSSL: 3.4.1 - /opt/homebrew/bin/openssl
  Servers:
    Apache: 2.4.62 - /usr/sbin/apachectl
  IDEs:
    VSCode: 0.49.6 - /usr/local/bin/code
    Vim: 9.1 - /usr/bin/vim
    Xcode: /undefined - /usr/bin/xcodebuild
  Languages:
    Bash: 3.2.57 - /bin/bash
    Perl: 5.34.1 - /usr/bin/perl
    Python3: 3.12.5 - /Library/Frameworks/Python.framework/Versions/3.12/bin/python3
    Ruby: 2.6.10 - /usr/bin/ruby
  Databases:
    SQLite: 3.43.2 - /usr/bin/sqlite3
  Browsers:
    Brave Browser: 132.1.74.48
    Chrome: 136.0.7103.93
    Safari: 18.3.1

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions