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

bound element references arent triggering subscriptions when changing to null #2034

Closed
halfnelson opened this issue Jan 31, 2019 · 1 comment · Fixed by #3145
Closed

bound element references arent triggering subscriptions when changing to null #2034

halfnelson opened this issue Jan 31, 2019 · 1 comment · Fixed by #3145
Labels

Comments

@halfnelson
Copy link
Contributor

halfnelson commented Jan 31, 2019

https://v3.svelte.technology/repl?version=3.0.0-alpha25&gist=da9c704874c5bfed8827c14d35c8e3b4

Steps to Reproduce:

  • Bind an element to a variable
  • use that variable in another attribute binding
  • wrap the bound element in an if block that will remove it from the dom
  • trigger the false condition for the if block and observe that the attribute binding referencing the variable is not updated.

Expected Behaviour?:
When an element goes out of scope its binding variable is set to null, any reactive subscriptions to that variable will be updated including template expressions and $ expressions.

Actual Behaviour:
Neither the template binding or a reactive $ binding are updated, the value of the reference is null when logged to console though.

@Rich-Harris Rich-Harris added this to the 3.x milestone Apr 21, 2019
Rich-Harris added a commit that referenced this issue Jul 1, 2019
update bind:this references when setting to null
@Rich-Harris
Copy link
Member

Fixed in 3.6.3, thanks

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.

2 participants