Skip to content

Commit 0ce4917

Browse files
author
Kenneth Cheng
committed
add blur when mouseDown
1 parent b477a37 commit 0ce4917

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vue3-excel-editor",
33
"email": "apple.6502@gmail.com",
44
"description": "Vue3 plugin for displaying and editing the array-of-object in Excel style",
5-
"version": "1.0.54",
5+
"version": "1.0.55",
66
"main": "src/main.js",
77
"dependencies": {
88
"@vuepic/vue-datepicker": "^3.3.0",

src/VueExcelEditor.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2331,9 +2331,14 @@ export default defineComponent({
23312331
const row = e.target.parentNode
23322332
const colPos = Array.from(row.children).indexOf(e.target) - 1
23332333
const rowPos = Array.from(row.parentNode.children).indexOf(row)
2334+
2335+
if (colPos !== this.currentColPos || rowPos !== this.currentRowPos)
2336+
this.inputBoxBlur()
2337+
23342338
this.currentField = this.fields[colPos]
23352339
this.currentCell = row.children[colPos + 1]
23362340
this.currentRecord = this.table[this.pageTop + rowPos]
2341+
23372342
this.$emit('cell-click', {rowPos, colPos}, this.currentCell.textContent, this.currentRecord, this.currentField, this)
23382343
if (typeof this.currentField.cellClick === 'function')
23392344
this.currentField.cellClick(this.currentCell.textContent, this.currentRecord, rowPos, colPos, this.currentField, this)
@@ -2344,6 +2349,7 @@ export default defineComponent({
23442349
this.refresh()
23452350
return
23462351
}
2352+
23472353
setTimeout(() => this.inputBox.focus())
23482354
this.focused = true
23492355
this.moveInputSquare(rowPos, colPos)

0 commit comments

Comments
 (0)