Skip to content

Commit

Permalink
fix: weird state where wheel event fires too early
Browse files Browse the repository at this point in the history
  • Loading branch information
rpearce committed Jun 22, 2024
1 parent c265a83 commit e0dc046
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/Controlled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,6 @@ class ControlledBase extends React.Component<ControlledPropsWithDefaults, Contro
this.setState({ modalState: ModalState.LOADING })
this.loadZoomImg()

window.addEventListener('wheel', this.handleWheel, { passive: true })
window.addEventListener('touchstart', this.handleTouchStart, { passive: true })
window.addEventListener('touchmove', this.handleTouchMove, { passive: true })
window.addEventListener('touchend', this.handleTouchEnd, { passive: true })
Expand All @@ -637,6 +636,7 @@ class ControlledBase extends React.Component<ControlledPropsWithDefaults, Contro
setTimeout(() => {
this.setState({ modalState: ModalState.LOADED })
window.addEventListener('resize', this.handleResize, { passive: true })
window.addEventListener('wheel', this.handleWheel, { passive: true })
}, 0)
}

Expand Down

0 comments on commit e0dc046

Please sign in to comment.