@@ -94,7 +94,9 @@ describe("draggable.vue with swap plugin", () => {
9494 onStart ( startEvent ) ;
9595 await nextTick ( ) ;
9696
97- // console.log(Array.from(vm.targetDomElement.children))
97+ const temp = vm . targetDomElement . children [ 0 ]
98+ vm . targetDomElement . replaceChild ( vm . targetDomElement . children [ 2 ] , vm . targetDomElement . children [ 0 ] )
99+ vm . targetDomElement . replaceChild ( temp , vm . targetDomElement . children [ 2 ] )
98100 // drop to last item
99101 const updateEvent = {
100102 from : wrapper . element ,
@@ -131,7 +133,9 @@ describe("draggable.vue with swap plugin", () => {
131133 onStart ( startEvent ) ;
132134 await nextTick ( ) ;
133135
134- // console.log(Array.from(vm.targetDomElement.children))
136+ const temp = vm . targetDomElement . children [ 0 ]
137+ vm . targetDomElement . replaceChild ( vm . targetDomElement . children [ 3 ] , vm . targetDomElement . children [ 0 ] )
138+ vm . targetDomElement . appendChild ( temp )
135139 // drop to last item
136140 const updateEvent = {
137141 from : wrapper . element ,
@@ -191,6 +195,9 @@ describe("draggable.vue with swap plugin", () => {
191195 await nextTick ( ) ;
192196
193197 // console.log(Array.from(vm.targetDomElement.children))
198+ const temp = vm . targetDomElement . children [ 1 ]
199+ vm . targetDomElement . replaceChild ( vm . targetDomElement . children [ 3 ] , vm . targetDomElement . children [ 1 ] )
200+ vm . targetDomElement . replaceChild ( temp , vm . targetDomElement . children [ 3 ] )
194201 // drop to last item
195202 const updateEvent = {
196203 from : wrapper . element ,
@@ -228,6 +235,9 @@ describe("draggable.vue with swap plugin", () => {
228235 await nextTick ( ) ;
229236
230237 // console.log(Array.from(vm.targetDomElement.children))
238+ const temp = vm . targetDomElement . children [ 1 ]
239+ vm . targetDomElement . replaceChild ( vm . targetDomElement . children [ 4 ] , vm . targetDomElement . children [ 1 ] )
240+ vm . targetDomElement . appendChild ( temp )
231241 // drop to last item
232242 const updateEvent = {
233243 from : wrapper . element ,
@@ -290,6 +300,9 @@ describe("draggable.vue with swap plugin", () => {
290300 await nextTick ( ) ;
291301
292302 // console.log(Array.from(vm.targetDomElement.children))
303+ const temp = vm . targetDomElement . children [ 0 ]
304+ vm . targetDomElement . replaceChild ( vm . targetDomElement . children [ 2 ] , vm . targetDomElement . children [ 0 ] )
305+ vm . targetDomElement . replaceChild ( temp , vm . targetDomElement . children [ 2 ] )
293306 // drop to last item
294307 const updateEvent = {
295308 from : wrapper . element ,
@@ -327,6 +340,9 @@ describe("draggable.vue with swap plugin", () => {
327340 await nextTick ( ) ;
328341
329342 // console.log(Array.from(vm.targetDomElement.children))
343+ const temp = vm . targetDomElement . children [ 0 ]
344+ vm . targetDomElement . replaceChild ( vm . targetDomElement . children [ 3 ] , vm . targetDomElement . children [ 0 ] )
345+ vm . targetDomElement . appendChild ( temp )
330346 // drop to last item
331347 const updateEvent = {
332348 from : wrapper . element ,
@@ -389,6 +405,9 @@ describe("draggable.vue with swap plugin", () => {
389405 group1 . onStart ( startEvent ) ;
390406 await nextTick ( ) ;
391407
408+ const temp = group2 . vm . targetDomElement . children [ 0 ]
409+ group2 . vm . targetDomElement . replaceChild ( group1 . vm . targetDomElement . children [ 0 ] , group2 . vm . targetDomElement . children [ 0 ] )
410+ group1 . vm . targetDomElement . insertBefore ( temp , group1 . vm . targetDomElement . children [ 0 ] )
392411 const addEvent = {
393412 from : group1 . wrapper . element ,
394413 to : group2 . wrapper . element ,
@@ -483,6 +502,9 @@ describe("draggable.vue with swap plugin", () => {
483502 group1 . onStart ( startEvent ) ;
484503 await nextTick ( ) ;
485504
505+ const temp = group2 . vm . targetDomElement . children [ 0 ]
506+ group2 . vm . targetDomElement . replaceChild ( group1 . vm . targetDomElement . children [ 0 ] , group2 . vm . targetDomElement . children [ 0 ] )
507+ group1 . vm . targetDomElement . insertBefore ( temp , group1 . vm . targetDomElement . children [ 0 ] )
486508 const addEvent = {
487509 from : group1 . wrapper . element ,
488510 to : group2 . wrapper . element ,
0 commit comments