-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Two-way binding observers not initialised in some circumstances #708
Comments
Should there be a separate issue created for the binding-in-an-array-with-a-key-when-the-keys-change issue? On that topic, remembering this thing from chat, I tried doing this to work around that issue, but it didn't seem to help. |
@TehShrike not 100% sure I understand what that issue is, but it sounds like the answer is 'probably' 😀 |
That was the "I need to use keyed list iteration" issue - I'll open a different issue for the issue I found with keyed blocks. |
Another wild bug courtesy of @TehShrike. Repro here.
Essentially what happens is this:
oncreate
function is successfully called for each<Top>
component, andcomponent.get('top')
is correctcomponent._set(...)
to happen (component
beingApp.html
in this case), which triggers anupdate
of the main fragment, which causestop
to becomeundefined
for the remaining<Top>
components, because their bindings haven't been initialised yet soidToTop
is incompletediffers
check returns false, because the value oftop
isundefined
, which means the observer is not initialised.So somehow we need to prevent the
_set
from causing theupdate
. If we can figure that out, then we'll also be saving some unnecessary work from happening (the top-level component couldupdate
just once, instead of three times).Answers on a postcard...
The text was updated successfully, but these errors were encountered: