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

Batched change notifies child component before parent stache binding #2252

Closed
dylanrtt opened this issue Feb 11, 2016 · 3 comments
Closed

Batched change notifies child component before parent stache binding #2252

dylanrtt opened this issue Feb 11, 2016 · 3 comments
Assignees
Milestone

Comments

@dylanrtt
Copy link
Contributor

This bug was introduced in 2.3 (absent in 2.2.9), and is still present in 2.3.15.

{{#eq page 'view'}}
  <foo-view page="{page}"></foo-view>
{{/eq}}

If <foo-view> binds to page, and page is changed in a batch, it seems the component is notified of the change before the stache binding. The stache binding should be called back first to remove the component and hopefully prevent the other batched event from running (however that works).

http://jsbin.com/xeqosawako/edit?html,js,console,output

@justinbmeyer
Copy link
Contributor

There's an issue keeping this for 3.0. Essentially, live-binding relied on a synchronous notification of removed events to teardown the bindings.

In 3.0, for performance reasons, I was hoping to use MutationObservers to know when elements are added or removed. MutationObservers dispatch at the next turn.

I'm going to try to come up with a way for this to work without having to resort to synchronous "removed" events.

@justinbmeyer
Copy link
Contributor

actually, listening to nodeLists teardown should work.

@justinbmeyer
Copy link
Contributor

Issue moved to canjs/can-stache-bindings #278 via ZenHub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants