Skip to content

Commit

Permalink
add wheelSensitivity prop
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Cheng committed Jan 4, 2024
1 parent 9869936 commit 7714284
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vue3-excel-editor",
"email": "[email protected]",
"description": "Vue3 plugin for displaying and editing the array-of-object in Excel style",
"version": "1.0.22",
"version": "1.0.23",
"main": "src/main.js",
"dependencies": {
"@vuepic/vue-datepicker": "^3.3.0",
Expand Down
5 changes: 3 additions & 2 deletions src/VueExcelEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ export default defineComponent({
nFilterCount: {type: Number, default: 1000}, // show top n values in filter dialog
height: {type: String, default: ''},
width: {type: String, default: '100%'},
wheelSensitivity: {type: Number, default: 30},
autocomplete: {type: Boolean, default: false}, // Default autocomplete of all columns
autocompleteCount: {type: Number, default: 50},
readonly: {type: Boolean, default: false},
Expand Down Expand Up @@ -1260,8 +1261,8 @@ export default defineComponent({
mousewheel (e) {
if (this.noMouseScroll || !this.mousein || !e.deltaY) return
let adjust = 0
if (e.deltaY > 30 && this.pageTop + this.pageSize < this.table.length) adjust = 1
else if (e.deltaY < -30 && this.pageTop > 0) adjust = -1
if (e.deltaY > 1 * this.wheelSensitivity && this.pageTop + this.pageSize < this.table.length) adjust = 1
else if (e.deltaY < -1 * this.wheelSensitivity && this.pageTop > 0) adjust = -1
if (adjust) {
this.pageTop += adjust
setTimeout(this.calVScroll)
Expand Down

0 comments on commit 7714284

Please sign in to comment.