Skip to content

Commit

Permalink
fix(item-sliding): closing an item can no longer be interrupted (#23973)
Browse files Browse the repository at this point in the history
resolves #23969
  • Loading branch information
liamdebeasi authored Sep 23, 2021
1 parent aa4ba89 commit 3ca0419
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion core/src/components/item-sliding/item-sliding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -394,16 +394,28 @@ export class ItemSliding implements ComponentInterface {
? SlidingState.Start | SlidingState.SwipeStart
: SlidingState.Start;
} else {
/**
* Item sliding cannot be interrupted
* while closing the item. If it did,
* it would allow the item to get into an
* inconsistent state where multiple
* items are then open at the same time.
*/
if (this.gesture) {
this.gesture.enable(false);
}
this.tmr = setTimeout(() => {
this.state = SlidingState.Disabled;
this.tmr = undefined;
if (this.gesture) {
this.gesture.enable(true);
}
}, 600) as any;

openSlidingItem = undefined;
style.transform = '';
return;
}

style.transform = `translate3d(${-openAmount}px,0,0)`;
this.ionDrag.emit({
amount: openAmount,
Expand Down

0 comments on commit 3ca0419

Please sign in to comment.