diff --git a/packages/mgt-components/src/components/mgt-todo/mgt-todo.ts b/packages/mgt-components/src/components/mgt-todo/mgt-todo.ts index 9968f6d171..22bc33fe19 100644 --- a/packages/mgt-components/src/components/mgt-todo/mgt-todo.ts +++ b/packages/mgt-components/src/components/mgt-todo/mgt-todo.ts @@ -555,6 +555,15 @@ export class MgtTodo extends MgtTasksBase { this._newTaskName = ''; this._changedTaskName = ''; this._isChangedDueDate = false; + this.focusOnTaskInput(); + }; + + protected focusOnTaskInput = (): void => { + const taskInputWrapper = this.renderRoot.querySelector('#new-task-name-input'); + const input = taskInputWrapper?.shadowRoot.querySelector('input'); + if (input) { + input.focus(); + } }; /**