Skip to content

Commit 6193560

Browse files
committed
fix(sliding-item): super slow device does get correct classes
fixes #11988
1 parent 1a4aacf commit 6193560

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/components/item/item-sliding.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -344,24 +344,24 @@ export class ItemSliding {
344344

345345
if (isFinal) {
346346
this.item.setElementStyle(platform.Css.transition, '');
347+
}
347348

348-
} else {
349-
if (openAmount > 0) {
350-
var state = (openAmount >= (this._optsWidthRightSide + SWIPE_MARGIN))
351-
? SlidingState.Right | SlidingState.SwipeRight
352-
: SlidingState.Right;
349+
if (openAmount > 0) {
350+
var state = (openAmount >= (this._optsWidthRightSide + SWIPE_MARGIN))
351+
? SlidingState.Right | SlidingState.SwipeRight
352+
: SlidingState.Right;
353+
354+
this._setState(state);
353355

354-
this._setState(state);
356+
} else if (openAmount < 0) {
357+
var state = (openAmount <= (-this._optsWidthLeftSide - SWIPE_MARGIN))
358+
? SlidingState.Left | SlidingState.SwipeLeft
359+
: SlidingState.Left;
355360

356-
} else if (openAmount < 0) {
357-
var state = (openAmount <= (-this._optsWidthLeftSide - SWIPE_MARGIN))
358-
? SlidingState.Left | SlidingState.SwipeLeft
359-
: SlidingState.Left;
361+
this._setState(state);
360362

361-
this._setState(state);
362-
}
363-
}
364-
if (openAmount === 0) {
363+
} else {
364+
assert(openAmount === 0, 'bad internal state');
365365
this._tmr = platform.timeout(() => {
366366
this._setState(SlidingState.Disabled);
367367
this._tmr = null;
@@ -371,7 +371,7 @@ export class ItemSliding {
371371
}
372372

373373
this.item.setElementStyle(platform.Css.transform, `translate3d(${-openAmount}px,0,0)`);
374-
let ionDrag = this.ionDrag;
374+
const ionDrag = this.ionDrag;
375375
if (ionDrag.observers.length > 0) {
376376
ionDrag.emit(this);
377377
}

0 commit comments

Comments
 (0)