From 3ca04197a4186c85d04cdf04fa9cb2689ca1bbfb Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Thu, 23 Sep 2021 16:08:33 -0400 Subject: [PATCH] fix(item-sliding): closing an item can no longer be interrupted (#23973) resolves #23969 --- core/src/components/item-sliding/item-sliding.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/core/src/components/item-sliding/item-sliding.tsx b/core/src/components/item-sliding/item-sliding.tsx index b2a854975c..311aa13953 100644 --- a/core/src/components/item-sliding/item-sliding.tsx +++ b/core/src/components/item-sliding/item-sliding.tsx @@ -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,