mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 18:54:24 +00:00
chore: use preventDefault util (#4412)
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user