提交 6a185057 编写于 作者: Q qiang

fix(App): 禁用 iOS 双击包含(滚动)手势

上级 b28d51dd
if (__PLATFORM__ === 'app-plus' && String(navigator.vendor).indexOf('Apple') === 0) {
let firstEvent
let timeout
// 用于全局禁用 iOS 双击包含手势
document.documentElement.addEventListener('click', event => {
const TIME_MAX = 450
const PAGE_MAX = 44
clearTimeout(timeout)
if (firstEvent && Math.abs(event.pageX - firstEvent.pageX) <= PAGE_MAX && Math.abs(event.pageY - firstEvent.pageY) <= PAGE_MAX && event.timeStamp - firstEvent.timeStamp <= TIME_MAX) {
event.preventDefault()
}
firstEvent = event
timeout = setTimeout(() => {
firstEvent = null
}, TIME_MAX)
})
}
......@@ -13,6 +13,8 @@ import {
createComponentDescriptor
} from './wxs/component-descriptor'
import './gesture'
function pageMounted () {
// 通知 Service,View 层已 ready
UniViewJSBridge.publishHandler('onPageReady', {}, this.$page.id)
......@@ -100,4 +102,4 @@ export default {
})
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册