-
-
Notifications
You must be signed in to change notification settings - Fork 629
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
"ref" attribute is set to null after element is removed with "if" attribute #164
Comments
I've confirmed this bug too |
Well, the ref binding does null out the property when it is unbound. It was done originally, thinking that there might be a memory leak issue if it was left hanging around. However, this would probably only be an issue if the view model was a singleton and not disposed along with its view. But, that may not be addressing the issue. It sounds like when the view is re-bound that it isn't getting the ref set again. I will need to explore this further... |
Right, the ref is not being bound again to the model property when the custom element is attached. |
@EisenbergEffect, can you confirm that your commit from Aug 4 actually fixed the problem concerning rebinding the ref when the view is re-bound? |
@kevmeister68 It should have, yes. However, there have been more changes made to the ref binding command since last year. Are you having an issue? If so can you create a new ticket on Github and cc @jdanyow on that. If there's an issue, he's the best person to track it down. |
@kevmeister68 looks like it's working: https://gist.run/?id=cae35b0bfd7510d797e8e0ef88b4af2c |
app.js
app.html
The first time you click the button, the
ref
value will be set correctly. If you click the button two more times to hide and show the div, then theref
value will be null. Is this expected behavior?I've created the issue here if you want to check it out: https://github.com/decademoon/aurelia-ref-null
The text was updated successfully, but these errors were encountered: