Partial defined by registerView throws error after element is modified #2174

Closed
mjstahl opened this Issue Jan 8, 2016 · 0 comments

Comments

Projects
None yet
2 participants
@mjstahl
Member

mjstahl commented Jan 8, 2016

can.view.registerView('partial', '{{name}}');

var data = new can.Map({
  items: [
    {name: 'foo'},
    {name: 'bar'},
    {name: 'baz'}
  ]
});

var renderer = can.stache('{{#each items}}{{>partial}}{{/each}}');

can.$(document.body).append(renderer(data));

setTimeout(function() {
  data.attr('items.0.name', 'WORLD');
}, 1000);

setTimeout(function(){
  data.attr('items').splice(0, 0, {name: 'HELLO'});
}, 2000);

Uncaught TypeError: Cannot read property 'insertBefore' of null

can.insertBefore @ can.jquery.js:685add @ can.jquery.js:4325can.dispatch @ can.jquery.js:546can.batch.stop @ can.jquery.js:1433Map.extend.splice @ can.jquery.js:3246(anonymous function) @ dalamevoca.js:20

@justinbmeyer justinbmeyer added the bug label Jan 8, 2016

@justinbmeyer justinbmeyer added this to the 2.3.9 milestone Jan 8, 2016

justinbmeyer added a commit that referenced this issue Jan 8, 2016

mjstahl added a commit that referenced this issue Jan 11, 2016

fixes #2174 by passing parse state around right and passing nodeLists
Use latest Testee

Partials should leave binding to their helpers and properties

Changed jquery dependecies to less than 2.2.0

Evaluate un-observed partial rendering functions

can.__notObserve needs a funtion as an argument

Fix up tests to run across all platforms

@daffl daffl closed this in #2175 Jan 11, 2016

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