Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dddb928

Browse files
fix: TouchEvent not supported in Safari #329 (#330)
1 parent 908621d commit dddb928

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

‎packages/vue-final-modal/src/dom.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { noop } from '~/utils'
22

33
export const getPosition = (e: TouchEvent | MouseEvent) => {
4-
if (e instanceof TouchEvent) {
5-
const { clientX: x, clientY: y } = e.targetTouches[0]
4+
if (e instanceof MouseEvent) {
5+
const { clientX: x, clientY: y } = e
66
return { x, y }
77
}
88
else {
9-
const { clientX: x, clientY: y } = e
9+
const { clientX: x, clientY: y } = e.targetTouches[0]
1010
return { x, y }
1111
}
1212
}

‎packages/vue-final-modal/src/useSwipeToClose.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ export function useSwipeToClose(
1717

1818
const vfmContentEl = ref<HTMLDivElement>()
1919
const swipeBannerEl = ref<HTMLDivElement>()
20-
const swipeEl = computed(() => (props.showSwipeBanner ? swipeBannerEl.value : vfmContentEl.value))
20+
const swipeEl = computed(() => {
21+
if (props.swipeToClose === undefined || props.swipeToClose === 'none')
22+
return undefined
23+
else
24+
return (props.showSwipeBanner ? swipeBannerEl.value : vfmContentEl.value)
25+
})
2126

2227
const offset = ref(0)
2328
const isCollapsed = ref<boolean | undefined>(true)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /