Skip to content

Commit 3a68a2c

Browse files
committed
fix(ionList): make reorder follow an offset list as it scrolls
1 parent 3e5b39f commit 3a68a2c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Diff for: js/views/listView.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@
193193
ReorderDrag.prototype._moveElement = function(e) {
194194
var y = e.gesture.center.pageY -
195195
this._currentDrag.elementHeight +
196-
this._currentDrag.scrollDelta -
196+
this.scrollView.getValues().top -
197197
this.listEl.offsetTop;
198198
this.el.style[ionic.CSS.TRANSFORM] = 'translate3d(0, '+y+'px, 0)';
199199
};
@@ -215,8 +215,7 @@
215215
startIndex: startIndex,
216216
placeholder: placeholder,
217217
scrollHeight: scroll,
218-
list: placeholder.parentNode,
219-
scrollDelta: 0
218+
list: placeholder.parentNode
220219
};
221220

222221
this._moveElement(e);
@@ -243,12 +242,10 @@
243242

244243
if (e.gesture.deltaY < 0 && pixelsPastTop > 0 && scrollY > 0) {
245244
this.scrollView.scrollBy(null, -pixelsPastTop);
246-
this._currentDrag.scrollDelta -= pixelsPastTop;
247245
}
248246
if (e.gesture.deltaY > 0 && pixelsPastBottom > 0) {
249247
if (scrollY < this.scrollView.getScrollMax().top) {
250248
this.scrollView.scrollBy(null, pixelsPastBottom);
251-
this._currentDrag.scrollDelta += pixelsPastBottom;
252249
}
253250
}
254251
}

0 commit comments

Comments
 (0)