mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 21:48:42 +08:00
fix(reorder): canceled reorder is animated smoothly back
references #7142
This commit is contained in:
@ -113,8 +113,18 @@ export class ItemReorderGesture {
|
||||
|
||||
let toIndex = this.lastToIndex;
|
||||
let fromIndex = indexForItem(this.selectedItemEle);
|
||||
this.selectedItemEle.classList.remove(ITEM_REORDER_ACTIVE);
|
||||
this.selectedItemEle = null;
|
||||
let reorderInactive = () => {
|
||||
this.selectedItemEle.style.transition = '';
|
||||
this.selectedItemEle.classList.remove(ITEM_REORDER_ACTIVE);
|
||||
this.selectedItemEle = null;
|
||||
};
|
||||
|
||||
if (toIndex === fromIndex) {
|
||||
this.selectedItemEle.style.transition = 'transform 200ms ease-in-out';
|
||||
setTimeout(reorderInactive, 200);
|
||||
} else {
|
||||
reorderInactive();
|
||||
}
|
||||
this.list.reorderEmit(fromIndex, toIndex);
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ ion-reorder {
|
||||
.reorder-active {
|
||||
z-index: 4;
|
||||
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, .5);
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, .4);
|
||||
opacity: .8;
|
||||
transition: none;
|
||||
|
||||
|
Reference in New Issue
Block a user