From aed7419e8e43377605a6e17026e74eee653cde24 Mon Sep 17 00:00:00 2001 From: Kris Zyp Date: Tue, 29 May 2012 15:58:45 -0600 Subject: [PATCH] Fix next node logic --- List.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/List.js b/List.js index 1f8df30f9..f8399859f 100644 --- a/List.js +++ b/List.js @@ -415,7 +415,7 @@ function(arrayUtil, kernel, declare, listen, aspect, has, miscUtil, TouchScroll, } if(to > -1){ // add to new slot (either before an existing row, or at the end) - row = self.newRow(object, rows[to] || (rows[to-1] && rows[to-1].nextSibling) || beforeNode, to, options); + row = self.newRow(object, rows[to] || beforeNode.parentNode ? beforeNode : (rows[to-1] && rows[to-1].nextSibling), to, options); if(row){ row.observerIndex = observerIndex; rows.splice(to, 0, row);