Skip to content

Commit af2af39

Browse files
committed
Added requested changes @ line ~558
1 parent 7c77c15 commit af2af39

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

source/Controlled.tsx

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -556,19 +556,17 @@ class ControlledBase extends React.Component<ControlledPropsWithDefaults, Contro
556556
const browserScale = window.visualViewport?.scale ?? 1
557557

558558
if (!this.isScaling && browserScale <= 1 && this.touchYStart != null && e.changedTouches[0]) {
559-
if (this.touchYStart != null && e.changedTouches[0]) {
560-
this.touchYEnd = e.changedTouches[0].screenY
561-
562-
const max = Math.max(this.touchYStart, this.touchYEnd)
563-
const min = Math.min(this.touchYStart, this.touchYEnd)
564-
const delta = Math.abs(max - min)
565-
const { swipeToUnzoomThreshold } = this.props
566-
567-
if (delta > swipeToUnzoomThreshold) {
568-
this.touchYStart = undefined
569-
this.touchYEnd = undefined
570-
this.handleUnzoom()
571-
}
559+
this.touchYEnd = e.changedTouches[0].screenY
560+
561+
const max = Math.max(this.touchYStart, this.touchYEnd)
562+
const min = Math.min(this.touchYStart, this.touchYEnd)
563+
const delta = Math.abs(max - min)
564+
const { swipeToUnzoomThreshold } = this.props
565+
566+
if (delta > swipeToUnzoomThreshold) {
567+
this.touchYStart = undefined
568+
this.touchYEnd = undefined
569+
this.handleUnzoom()
572570
}
573571
}
574572
}

0 commit comments

Comments
 (0)