svelte icon indicating copy to clipboard operation
svelte copied to clipboard

`bind:this` weird behavior

Open CNSeniorious000 opened this issue 6 months ago • 5 comments

Describe the bug

<Container>
  <div bind:this={ref}>
    <Content {ref} />
  </div>
</Container>

When Container got updated, the div seems to be a new one, but the ref points to the old one.

Reproduction

open_in_stackblitz

Logs

No response

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    svelte: ^4.2.7 => 4.2.18

Severity

annoyance

CNSeniorious000 avatar Aug 08 '24 19:08 CNSeniorious000