This is happening on 1.5 stable with the Collection Fast Path mixin. If I drag an item from one list and move it to an empty list, I get the following error at the console:
Uncaught TypeError: Cannot call method 'get' of null
Digging further, it seems that "showInsertionPoint" implemented in SC.ListView is trying to perform:
var index = itemView.get('contentIndex');
...which is NULL due to the following line in "dragUpdated" in SC.CollectionView:
var itemView = this.itemViewForContentIndex(idx);
It appears that when dropping an item on an empty SC.ListView, the index is -1. When using the SC.CollectionFastPath mixin, "itemViewForContentIndex" does not properly return an itemView if index is -1.
I am not familiar with how the mixin speeds things up and thus what the right fix.
Yep, had the same problem. The implementations of these methods are fundamentally different. The only thing I could do was to remove the mixin. :(
The sign of a premier framework is a high functioning collection view and as such I think we should target bringing fast path into SC.CollectionView and addressing these issues in the next Major release.
The offending code is still in there, and calling SC.ListView#showInsertionPoint(null, SC.DRAG_MOVE) still triggers an error, but I failed at a cursory attempt at reproduction. Is this issue still an issue? My hunch is yes. The fix would be to update showInsertionPoint to check itemView for existence and provide default values in case it doesn't.
Adds unit test proving empty list view drag bug (#402).
Fixes bug where dragging content onto an empty list view would throw …
…an error. Resolves #402.