Browse Source

fix: event cancelable bug

yangkaixuan 5 years ago
parent
commit
31b0f1928e
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/packages/popup/popup.vue

+ 3 - 1
src/packages/popup/popup.vue

@@ -178,7 +178,9 @@ export default {
       const { scrollHeight, offsetHeight, scrollTop } = el ? el : this.$el;
       const { scrollHeight, offsetHeight, scrollTop } = el ? el : this.$el;
 
 
       if ((this.deltaY > 0 && scrollTop === 0) || (this.deltaY < 0 && scrollTop + offsetHeight >= scrollHeight)) {
       if ((this.deltaY > 0 && scrollTop === 0) || (this.deltaY < 0 && scrollTop + offsetHeight >= scrollHeight)) {
-        event.preventDefault();
+        if (event.cancelable) {
+          event.preventDefault();
+        }
       }
       }
     },
     },
     getScroller(el) {
     getScroller(el) {