fix: hide "title required" error after entering text
This commit is contained in:
parent
1256c37b69
commit
45c05296a6
1 changed files with 7 additions and 1 deletions
|
@ -10,7 +10,7 @@
|
|||
v-focus
|
||||
v-model="newTaskTitle"
|
||||
ref="newTaskInput"
|
||||
@keyup="errorMessage = ''"
|
||||
@keyup="resetEmptyTitleError"
|
||||
@keydown.enter="handleEnter"
|
||||
/>
|
||||
<span class="icon is-small is-left">
|
||||
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue