From 45c05296a6a95a16cbbf1404107cbd16b6b8cd34 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 26 Feb 2022 13:05:39 +0100 Subject: [PATCH] fix: hide "title required" error after entering text --- src/components/tasks/add-task.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/tasks/add-task.vue b/src/components/tasks/add-task.vue index 0ddc6155..ab079f28 100644 --- a/src/components/tasks/add-task.vue +++ b/src/components/tasks/add-task.vue @@ -10,7 +10,7 @@ v-focus v-model="newTaskTitle" ref="newTaskInput" - @keyup="errorMessage = ''" + @keyup="resetEmptyTitleError" @keydown.enter="handleEnter" /> @@ -135,6 +135,12 @@ const store = useStore() const taskService = shallowReactive(new TaskService()) const errorMessage = ref('') +function resetEmptyTitleError() { + if(newTaskTitle.value !== '') { + errorMessage.value = '' + } +} + async function addTask() { if (newTaskTitle.value === '') { errorMessage.value = t('list.create.addTitleRequired')