mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(SlideDrag) clears drag when list is scrolled or new drag starts
This also fixes the broken $ionicListDelegate.clearOptionButtons() method. Makes lists feel more natural inline with iOS functionality and fixes issues with using ion-option-buttons with collection repeat
This commit is contained in:
@@ -170,11 +170,10 @@
|
||||
|
||||
|
||||
// Kill the current drag
|
||||
if (_this._lastDrag) {
|
||||
_this._lastDrag.buttons = null;
|
||||
_this._lastDrag.content = null;
|
||||
if (!_this._lastDrag) {
|
||||
_this._lastDrag = {};
|
||||
}
|
||||
_this._lastDrag = _this._currentDrag;
|
||||
angular.extend(_this._lastDrag, _this._currentDrag);
|
||||
if (_this._currentDrag) {
|
||||
_this._currentDrag.buttons = null;
|
||||
_this._currentDrag.content = null;
|
||||
@@ -517,6 +516,11 @@
|
||||
var lastDragOp = this._lastDragOp;
|
||||
var item;
|
||||
|
||||
// If we have an open SlideDrag and we're scrolling the list. Clear it.
|
||||
if (this._didDragUpOrDown && lastDragOp instanceof SlideDrag) {
|
||||
lastDragOp.clean && lastDragOp.clean();
|
||||
}
|
||||
|
||||
// Check if this is a reorder drag
|
||||
if (ionic.DomUtil.getParentOrSelfWithClass(e.target, ITEM_REORDER_BTN_CLASS) && (e.gesture.direction == 'up' || e.gesture.direction == 'down')) {
|
||||
item = this._getItem(e.target);
|
||||
|
||||
Reference in New Issue
Block a user