Skip to content

Attachment using createAttachmentKey re-runs when other spread state changes #16044

@CaptainCodeman

Description

@CaptainCodeman

Describe the bug

Looks like a similar issue to #15949 but if other spread props are updated the attachment still re-runs.

I would expect to be able to attach behaviour to an element using createAttachmentKey while also setting attributes on the element (such as wai-aria).

Reproduction

https://svelte.dev/playground/542b5db158e148feafde1451c6cbd900?version=5.33.10

(click button, notice console log output showing attachment re-runs)

Logs

System Info

System:
    OS: macOS 15.5
    CPU: (10) arm64 Apple M1 Pro
    Memory: 1.68 GB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.12.0 - ~/Library/pnpm/node
    npm: 11.1.0 - ~/Library/pnpm/npm
    pnpm: 10.11.0 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 136.0.7103.116
    Safari: 18.5
  npmPackages:
    svelte: ^5.0.0 => 5.33.10

Severity

blocking an upgrade

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions