diff --git a/packages/frontend/editor-ui/src/app/components/MainHeader/ActionsDropdownMenu.vue b/packages/frontend/editor-ui/src/app/components/MainHeader/ActionsDropdownMenu.vue index 3bf7a6bee7b..95adbbbaf1a 100644 --- a/packages/frontend/editor-ui/src/app/components/MainHeader/ActionsDropdownMenu.vue +++ b/packages/frontend/editor-ui/src/app/components/MainHeader/ActionsDropdownMenu.vue @@ -203,6 +203,8 @@ const workflowMenuItems = computed(() => { label: locale.baseText('generic.rename'), icon: { type: 'icon', value: 'pencil' }, disabled: props.workflowPermissions.update !== true, + // Focus moves to the name input; returning it to the trigger blurs and ends the edit. + suppressCloseAutoFocus: true, }); } diff --git a/packages/frontend/editor-ui/src/app/components/MainHeader/WorkflowDetails.test.ts b/packages/frontend/editor-ui/src/app/components/MainHeader/WorkflowDetails.test.ts index 784095f9005..a688eebb382 100644 --- a/packages/frontend/editor-ui/src/app/components/MainHeader/WorkflowDetails.test.ts +++ b/packages/frontend/editor-ui/src/app/components/MainHeader/WorkflowDetails.test.ts @@ -292,6 +292,21 @@ describe('WorkflowDetails', () => { }); describe('Workflow menu', () => { + it('should keep the name input in edit mode after the rename action', async () => { + workflowDocumentStoreRef.value?.setScopes(['workflow:update']); + const { getByTestId, queryByTestId } = renderComponent({ + props: { ...defaultProps }, + }); + + await userEvent.click(getByTestId('workflow-menu')); + await userEvent.click(getByTestId('workflow-menu-item-rename')); + + await vi.waitFor(() => + expect(queryByTestId('workflow-menu-item-rename')).not.toBeInTheDocument(), + ); + expect(getByTestId('inline-edit-input')).toHaveFocus(); + }); + it('should not show a dependencies entry when the workflow has none', async () => { workflowDocumentStoreRef.value?.setScopes(['workflow:read']); const { getByTestId, queryByTestId } = renderComponent({