airbnb/infinity

Error thrown when using listItem.remove()

Closed this issue · 4 comments

When calling the remove item on listView I am getting the following error:

var listItems = listView.find('article');
for(var index = 0, length = listItems.length; index < length; index++) {
  listItems[index].remove();
}
//> TypeError: Cannot read property 'items' of null

Any idea on how to fix this?
thanks

Just noting this is the same code found on infinity webpage for removing items, except I am selecting articles instead

Initially, can't reproduce in the Infinity demo -- calling remove on the ListItems seems to work. Can you give a more detailed stack trace, or steps to reproduce?

I encounter the same problem.

I reproduced it : http://jsfiddle.net/nRHFE/1/

There's an Uncaught TypeError: Cannot read property 'items' of null error when clicking on the button.

rc1 commented

This issue is old now, but still happening.

@airbnb any hints on why this is happening?