Skip to content

Commit d5db5a3

Browse files
committed
fixed bug
1 parent 36624f3 commit d5db5a3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/ve-table/src/editor/edit-input.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ export default {
9393
cellEl: null,
9494
// auto resize
9595
autoResize: null,
96+
// is edit cell focus
97+
isEditCellFocus: false,
9698
};
9799
},
98100
computed: {
@@ -207,11 +209,14 @@ export default {
207209
handler: function (val) {
208210
const { rowKey, colKey } = val;
209211
if (!isEmptyValue(rowKey) && !isEmptyValue(colKey)) {
212+
this.isEditCellFocus = true;
210213
this.setCellEl();
211214
// wait for selection cell rendered
212215
this.$nextTick(() => {
213216
this.setTextareaPosition();
214217
});
218+
} else {
219+
this.isEditCellFocus = false;
215220
}
216221
},
217222
deep: true,
@@ -427,6 +432,7 @@ export default {
427432
textareaClass,
428433
rawCellValue,
429434
isCellEditing,
435+
isEditCellFocus,
430436
} = this;
431437

432438
const containerProps = {
@@ -441,7 +447,7 @@ export default {
441447
{
442448
name: "focus",
443449
value: {
444-
focus: this.displayTextarea && !this.overflowViewport,
450+
focus: isEditCellFocus,
445451
},
446452
},
447453
],

0 commit comments

Comments
 (0)