mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(editor): Prevent text edit dialog from re-opening in same tick (#6781)
* fix: prevent reopenning textedit dialog in same tick * fix: add same logic for code edit dialog * fix: remove stop modifier * fix: blur input field when closing modal, removing default element-plus behaviour
This commit is contained in:
@@ -486,6 +486,7 @@ export default defineComponent({
|
|||||||
remoteParameterOptionsLoading: false,
|
remoteParameterOptionsLoading: false,
|
||||||
remoteParameterOptionsLoadingIssues: null as string | null,
|
remoteParameterOptionsLoadingIssues: null as string | null,
|
||||||
textEditDialogVisible: false,
|
textEditDialogVisible: false,
|
||||||
|
editDialogClosing: false,
|
||||||
tempValue: '', // el-date-picker and el-input does not seem to work without v-model so add one
|
tempValue: '', // el-date-picker and el-input does not seem to work without v-model so add one
|
||||||
CUSTOM_API_CALL_KEY,
|
CUSTOM_API_CALL_KEY,
|
||||||
activeCredentialType: '',
|
activeCredentialType: '',
|
||||||
@@ -922,6 +923,11 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
closeCodeEditDialog() {
|
closeCodeEditDialog() {
|
||||||
this.codeEditDialogVisible = false;
|
this.codeEditDialogVisible = false;
|
||||||
|
|
||||||
|
this.editDialogClosing = true;
|
||||||
|
void this.$nextTick(() => {
|
||||||
|
this.editDialogClosing = false;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
closeExpressionEditDialog() {
|
closeExpressionEditDialog() {
|
||||||
this.expressionEditDialogVisible = false;
|
this.expressionEditDialogVisible = false;
|
||||||
@@ -945,8 +951,18 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
closeTextEditDialog() {
|
closeTextEditDialog() {
|
||||||
this.textEditDialogVisible = false;
|
this.textEditDialogVisible = false;
|
||||||
|
|
||||||
|
this.editDialogClosing = true;
|
||||||
|
void this.$nextTick(() => {
|
||||||
|
this.$refs.inputField?.blur?.();
|
||||||
|
this.editDialogClosing = false;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
displayEditDialog() {
|
displayEditDialog() {
|
||||||
|
if (this.editDialogClosing) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.editorType) {
|
if (this.editorType) {
|
||||||
this.codeEditDialogVisible = true;
|
this.codeEditDialogVisible = true;
|
||||||
} else {
|
} else {
|
||||||
@@ -975,7 +991,7 @@ export default defineComponent({
|
|||||||
onResourceLocatorDrop(data: string) {
|
onResourceLocatorDrop(data: string) {
|
||||||
this.$emit('drop', data);
|
this.$emit('drop', data);
|
||||||
},
|
},
|
||||||
async setFocus() {
|
async setFocus(event: MouseEvent) {
|
||||||
if (['json'].includes(this.parameter.type) && this.getArgument('alwaysOpenEditWindow')) {
|
if (['json'].includes(this.parameter.type) && this.getArgument('alwaysOpenEditWindow')) {
|
||||||
this.displayEditDialog();
|
this.displayEditDialog();
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user