chore: use preventDefault util (#4412)

This commit is contained in:
neverland
2019-09-10 17:08:43 +08:00
committed by GitHub
parent 4b0cf5beda
commit f6f696ff73
10 changed files with 57 additions and 151 deletions

View File

@@ -3,6 +3,7 @@ import { TouchMixin } from '../mixins/touch';
import { ParentMixin } from '../mixins/relation';
import { BindEventMixin } from '../mixins/bind-event';
import { GREEN } from '../utils/constant';
import { preventDefault } from '../utils/dom/event';
import {
getScrollTop,
getElementTop,
@@ -168,10 +169,7 @@ export default createComponent({
this.touchMove(event);
if (this.direction === 'vertical') {
/* istanbul ignore else */
if (event.cancelable) {
event.preventDefault();
}
preventDefault(event);
const { clientX, clientY } = event.touches[0];
const target = document.elementFromPoint(clientX, clientY);