Skip to content

Commit

Permalink
fix(reorder): canceled reorder is animated smoothly back
Browse files Browse the repository at this point in the history
references #7142
  • Loading branch information
manucorporat committed Jul 2, 2016
1 parent f1433c6 commit 8483a43
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions src/components/item/item-reorder-gesture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/item/item-reorder.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 8483a43

Please sign in to comment.