fix: contain focus when selfClicking

pull/6984/head
KumJungMin 2024-12-22 15:35:23 +09:00
parent 37632982a9
commit b5ca6858a9
1 changed files with 3 additions and 5 deletions

View File

@ -304,11 +304,11 @@ export default {
bindDocumentEditListener() {
if (!this.documentEditListener) {
this.documentEditListener = (event) => {
this.selfClick = this.$el && this.$el.contains(event.target);
if (!this.selfClick) {
this.completeEdit(event, 'outside');
}
this.selfClick = false;
};
document.addEventListener('mousedown', this.documentEditListener);
@ -335,9 +335,7 @@ export default {
this.$emit('cell-edit-init', { originalEvent: event, data: this.rowData, field: this.field, index: this.rowIndex });
this.overlayEventListener = (e) => {
if (this.$el && this.$el.contains(e.target)) {
this.selfClick = true;
}
this.selfClick = this.$el && this.$el.contains(e.target);
};
OverlayEventBus.on('overlay-click', this.overlayEventListener);