Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit 8685ac3

Browse files
fix(#7): iOS swipe
1 parent db291d1 commit 8685ac3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/deck/deckdeckgo-deck/deckdeckgo-deck.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export class DeckdeckgoDeck {
161161
const couldSwipeRight: boolean = !deltaX.swipeLeft && this.activeIndex > 0;
162162

163163
if (couldSwipeLeft || couldSwipeRight) {
164-
const windowWidth: number = window.outerWidth;
164+
const windowWidth: number = window.innerWidth;
165165
if (deltaX.deltaX > (windowWidth / this.autoSwipeRatio)) {
166166
this.deckTranslateX = deltaX.swipeLeft ? this.deckTranslateX - windowWidth : this.deckTranslateX + windowWidth;
167167

@@ -289,7 +289,7 @@ export class DeckdeckgoDeck {
289289
const deltaX: DeltaX = {
290290
slider: slider,
291291
swipeLeft: swipeLeft,
292-
deltaX: window.outerWidth
292+
deltaX: window.innerWidth
293293
};
294294

295295
await this.swipeSlide(deltaX);
@@ -334,7 +334,7 @@ export class DeckdeckgoDeck {
334334
return;
335335
}
336336

337-
this.deckTranslateX = index * -1 * window.outerWidth;
337+
this.deckTranslateX = index * -1 * window.innerWidth;
338338
this.activeIndex = index;
339339

340340
await this.lazyLoadImages(this.activeIndex);

0 commit comments

Comments
 (0)