Skip to content

Commit

Permalink
fix(ui/image-preview): fix isTapTouch
Browse files Browse the repository at this point in the history
  • Loading branch information
haoziqaq committed Mar 4, 2022
1 parent 4481054 commit f5c38f8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/varlet-ui/src/image-preview/ImagePreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ type VarTouch = {
const DISTANCE_OFFSET = 12
const EVENT_DELAY = 200
const TAP_DELAY = 500
const ANIMATION_DURATION = 200
export default defineComponent({
Expand Down Expand Up @@ -170,6 +171,7 @@ export default defineComponent({
return (
getDistance(startTouch, prevTouch) <= DISTANCE_OFFSET &&
Date.now() - prevTouch.timestamp < TAP_DELAY &&
(target === startTouch.target || target.parentNode === startTouch.target)
)
}
Expand Down

0 comments on commit f5c38f8

Please sign in to comment.