[bugfix] Popup: may cause event uncancelable warning (#3150)

This commit is contained in:
neverland
2019-04-15 17:10:39 +08:00
committed by GitHub
parent 0e45d05ce2
commit ae73af819d
2 changed files with 18 additions and 8 deletions
+6 -5
View File
@@ -160,10 +160,10 @@ export const PopupMixin = {
}
},
onTouchMove(e) {
this.touchMove(e);
onTouchMove(event) {
this.touchMove(event);
const direction = this.deltaY > 0 ? '10' : '01';
const el = getScrollEventTarget(e.target, this.$el);
const el = getScrollEventTarget(event.target, this.$el);
const { scrollHeight, offsetHeight, scrollTop } = el;
let status = '11';
@@ -176,12 +176,13 @@ export const PopupMixin = {
/* istanbul ignore next */
if (
event.cancelable &&
status !== '11' &&
this.direction === 'vertical' &&
!(parseInt(status, 2) & parseInt(direction, 2))
) {
e.preventDefault();
e.stopPropagation();
event.preventDefault();
event.stopPropagation();
}
},