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

Commit cbc543d

Browse files
fix(#7): threshold was blocking swipe on fast iOS
1 parent 3e416e0 commit cbc543d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/components/slides/deckdeckgo-slide-code/deckdeckgo-slide-code.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export class DeckdeckgoSlideCode implements DeckdeckgoSlide {
3333
private code: string[] = [];
3434

3535
private startX: number = null;
36-
private detectThreshold: number = 10;
3736
private action: DeckdeckgoSlideCodeAction = null;
3837

3938
async componentDidLoad() {
@@ -166,8 +165,8 @@ export class DeckdeckgoSlideCode implements DeckdeckgoSlide {
166165

167166
const currentX: number = DeckDeckGoUtils.unifyEvent(event).clientX;
168167

169-
const swipeLeft: boolean = this.startX > currentX + this.detectThreshold;
170-
const swipeRight: boolean = this.startX < currentX - this.detectThreshold;
168+
const swipeLeft: boolean = this.startX > currentX;
169+
const swipeRight: boolean = this.startX < currentX;
171170

172171
this.action = swipeLeft || swipeRight ? DeckdeckgoSlideCodeAction.SWIPE : DeckdeckgoSlideCodeAction.SCROLL;
173172

0 commit comments

Comments
 (0)