Skip to content

Commit

Permalink
Update: SharedModal.tsx swipe bug in with-cloudinary (#44771)
Browse files Browse the repository at this point in the history
Co-authored-by: JJ Kasper <[email protected]>
  • Loading branch information
EmilianoGarciaLopez and ijjk authored Jan 11, 2023
1 parent 28afb88 commit 975d96a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions examples/with-cloudinary/components/SharedModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,16 @@ export default function SharedModal({
)

const handlers = useSwipeable({
onSwipedLeft: () => changePhotoId(index + 1),
onSwipedRight: () => changePhotoId(index - 1),
onSwipedLeft: () => {
if (index < images?.length - 1) {
changePhotoId(index + 1)
}
},
onSwipedRight: () => {
if (index > 0) {
changePhotoId(index - 1)
}
},
trackMouse: true,
})

Expand Down

0 comments on commit 975d96a

Please sign in to comment.