Skip to content

Commit

Permalink
Unzoom on touchmove instead of on touchend
Browse files Browse the repository at this point in the history
  • Loading branch information
eych committed Aug 1, 2023
1 parent d8cdf26 commit 6f8e96d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/Controlled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ class ControlledBase extends Component<ControlledPropsWithDefaults, ControlledSt
this.refModalImg.current?.removeEventListener?.('transitionend', this.handleUnzoomEnd)
window.removeEventListener('wheel', this.handleWheel)
window.removeEventListener('touchstart', this.handleTouchStart)
window.removeEventListener('touchend', this.handleTouchMove)
window.removeEventListener('touchmove', this.handleTouchMove)
window.removeEventListener('touchcancel', this.handleTouchCancel)
window.removeEventListener('resize', this.handleResize)
document.removeEventListener('keydown', this.handleKeyDown, true)
Expand Down Expand Up @@ -584,7 +584,7 @@ class ControlledBase extends Component<ControlledPropsWithDefaults, ControlledSt

window.addEventListener('wheel', this.handleWheel, { passive: true })
window.addEventListener('touchstart', this.handleTouchStart, { passive: true })
window.addEventListener('touchend', this.handleTouchMove, { passive: true })
window.addEventListener('touchmove', this.handleTouchMove, { passive: true })
window.addEventListener('touchcancel', this.handleTouchCancel, { passive: true })
document.addEventListener('keydown', this.handleKeyDown, true)

Expand Down Expand Up @@ -612,7 +612,7 @@ class ControlledBase extends Component<ControlledPropsWithDefaults, ControlledSt

window.removeEventListener('wheel', this.handleWheel)
window.removeEventListener('touchstart', this.handleTouchStart)
window.removeEventListener('touchend', this.handleTouchMove)
window.removeEventListener('touchmove', this.handleTouchMove)
window.removeEventListener('touchcancel', this.handleTouchCancel)
document.removeEventListener('keydown', this.handleKeyDown, true)

Expand Down

0 comments on commit 6f8e96d

Please sign in to comment.