Browse Source

ScrollBar: prevent right button click on thumb (#14196)

xifeiwu 6 years ago
parent
commit
e8e271a8ef
1 changed files with 4 additions and 0 deletions
  1. 4 0
      packages/scrollbar/src/bar.js

+ 4 - 0
packages/scrollbar/src/bar.js

@@ -40,6 +40,10 @@ export default {
 
   methods: {
     clickThumbHandler(e) {
+      // prevent click event of right button
+      if (e.ctrlKey || e.button === 2) {
+        return;
+      }
       this.startDrag(e);
       this[this.bar.axis] = (e.currentTarget[this.bar.offset] - (e[this.bar.client] - e.currentTarget.getBoundingClientRect()[this.bar.direction]));
     },