Skip to content

bind:this is undefined when using an action #12673

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

Closed
ChristopheCorbalan opened this issue Jul 31, 2024 · 1 comment · Fixed by #12679
Closed

bind:this is undefined when using an action #12673

ChristopheCorbalan opened this issue Jul 31, 2024 · 1 comment · Fixed by #12679
Assignees
Labels
Milestone

Comments

@ChristopheCorbalan
Copy link

Describe the bug

Hey there 👋🏻

It's been a while since I didn't give a try to Svelte 5 (last version I used was next.172) so my apologize in advance if this is an intended behavior.

When using bind:this on an HTML element and using an action on it causes the binded element to be undefined.
Removing the action does solve the issue.

Thanks!

Reproduction

Minimal REPL

Logs

No response

System Info

System:
    OS: macOS 14.4
    CPU: (12) arm64 Apple M2 Max
    Memory: 10.97 GB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.15.0 - ~/.nvm/versions/node/v20.15.0/bin/node
    npm: 10.7.0 - ~/.nvm/versions/node/v20.15.0/bin/npm
    bun: 1.1.13 - ~/.bun/bin/bun
  Browsers:
    Chrome: 127.0.6533.72
    Firefox Nightly: 128.0a1
    Safari: 17.4

Severity

blocking an upgrade

@dummdidumm dummdidumm added the bug label Jul 31, 2024
@dummdidumm dummdidumm added this to the 5.0 milestone Jul 31, 2024
@dummdidumm dummdidumm self-assigned this Jul 31, 2024
dummdidumm added a commit that referenced this issue Jul 31, 2024
fixes #12673

#12591 wrongfully applied the "wrap in effect if an action on this element" logic for `bind:this`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants