mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 11:49:59 +00:00
✨ Automatically select text in rename-prompt
This commit is contained in:
@@ -1428,13 +1428,26 @@ export default mixins(
|
|||||||
},
|
},
|
||||||
async renameNodePrompt (currentName: string) {
|
async renameNodePrompt (currentName: string) {
|
||||||
try {
|
try {
|
||||||
const promptResponse = await this.$prompt('New Name:', `Rename Node: "${currentName}"`, {
|
const promptResponsePromise = this.$prompt('New Name:', `Rename Node: "${currentName}"`, {
|
||||||
|
customClass: 'rename-prompt',
|
||||||
confirmButtonText: 'Rename',
|
confirmButtonText: 'Rename',
|
||||||
cancelButtonText: 'Cancel',
|
cancelButtonText: 'Cancel',
|
||||||
inputErrorMessage: 'Invalid Name',
|
inputErrorMessage: 'Invalid Name',
|
||||||
inputValue: currentName,
|
inputValue: currentName,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Wait till it had time to display
|
||||||
|
await Vue.nextTick();
|
||||||
|
|
||||||
|
// Get the input and select the text in it
|
||||||
|
const nameInput = document.querySelector('.rename-prompt .el-input__inner') as HTMLInputElement | undefined;
|
||||||
|
if (nameInput) {
|
||||||
|
nameInput.focus();
|
||||||
|
nameInput.select();
|
||||||
|
}
|
||||||
|
|
||||||
|
const promptResponse = await promptResponsePromise;
|
||||||
|
|
||||||
this.renameNode(currentName, promptResponse.value);
|
this.renameNode(currentName, promptResponse.value);
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user