diff --git a/packages/mgt-components/src/components/mgt-planner/mgt-planner.ts b/packages/mgt-components/src/components/mgt-planner/mgt-planner.ts index da1440342c..1162eb233b 100644 --- a/packages/mgt-components/src/components/mgt-planner/mgt-planner.ts +++ b/packages/mgt-components/src/components/mgt-planner/mgt-planner.ts @@ -592,12 +592,17 @@ export class MgtPlanner extends MgtTemplatedTaskComponent { await this._task.run(); } - private async removeTask(task: ITask) { + private async removeTask(task: ITask, e: Event) { const ts = this.getTaskSource(); if (!ts) { return; } - + // check if e is a Keyboard Event + if (e instanceof KeyboardEvent) { + if (e.key !== 'Enter') { + return; + } + } this._hiddenTasks = [...this._hiddenTasks, task.id]; await ts.removeTask(task); this.fireCustomEvent('taskRemoved', task); @@ -1004,7 +1009,7 @@ export class MgtPlanner extends MgtTemplatedTaskComponent { `;