diff --git a/frontend/src/components/tasks/partials/Heading.vue b/frontend/src/components/tasks/partials/Heading.vue index 9cb44bfba..71339161e 100644 --- a/frontend/src/components/tasks/partials/Heading.vue +++ b/frontend/src/components/tasks/partials/Heading.vue @@ -30,6 +30,7 @@ :spellcheck="false" @blur="save(($event.target as HTMLInputElement).textContent as string)" @keydown.enter.prevent.stop="($event.target as HTMLInputElement).blur()" + @keydown.esc.prevent.stop="cancel($event.target as HTMLInputElement)" > {{ task.title.trim() }} @@ -133,6 +134,11 @@ async function save(title: string) { saving.value = false } } + +async function cancel(element: HTMLInputElement) { + element.textContent = props.task.title + element.blur() +}