mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 06:34:05 -08:00
✨ Automatically select text in rename-prompt
This commit is contained in:
parent
117630fb68
commit
132f32132a
|
@ -1428,13 +1428,26 @@ export default mixins(
|
|||
},
|
||||
async renameNodePrompt (currentName: string) {
|
||||
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',
|
||||
cancelButtonText: 'Cancel',
|
||||
inputErrorMessage: 'Invalid Name',
|
||||
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);
|
||||
} catch (e) {}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue