fix: contain focus when selfClicking
parent
37632982a9
commit
b5ca6858a9
|
@ -304,11 +304,11 @@ export default {
|
||||||
bindDocumentEditListener() {
|
bindDocumentEditListener() {
|
||||||
if (!this.documentEditListener) {
|
if (!this.documentEditListener) {
|
||||||
this.documentEditListener = (event) => {
|
this.documentEditListener = (event) => {
|
||||||
|
this.selfClick = this.$el && this.$el.contains(event.target);
|
||||||
|
|
||||||
if (!this.selfClick) {
|
if (!this.selfClick) {
|
||||||
this.completeEdit(event, 'outside');
|
this.completeEdit(event, 'outside');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.selfClick = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
document.addEventListener('mousedown', this.documentEditListener);
|
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.$emit('cell-edit-init', { originalEvent: event, data: this.rowData, field: this.field, index: this.rowIndex });
|
||||||
|
|
||||||
this.overlayEventListener = (e) => {
|
this.overlayEventListener = (e) => {
|
||||||
if (this.$el && this.$el.contains(e.target)) {
|
this.selfClick = this.$el && this.$el.contains(e.target);
|
||||||
this.selfClick = true;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
OverlayEventBus.on('overlay-click', this.overlayEventListener);
|
OverlayEventBus.on('overlay-click', this.overlayEventListener);
|
||||||
|
|
Loading…
Reference in New Issue