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-focus
|
||||||
v-model="newTaskTitle"
|
v-model="newTaskTitle"
|
||||||
ref="newTaskInput"
|
ref="newTaskInput"
|
||||||
@keyup="errorMessage = ''"
|
@keyup="resetEmptyTitleError"
|
||||||
@keydown.enter="handleEnter"
|
@keydown.enter="handleEnter"
|
||||||
/>
|
/>
|
||||||
<span class="icon is-small is-left">
|
<span class="icon is-small is-left">
|
||||||
|
@ -135,6 +135,12 @@ const store = useStore()
|
||||||
const taskService = shallowReactive(new TaskService())
|
const taskService = shallowReactive(new TaskService())
|
||||||
const errorMessage = ref('')
|
const errorMessage = ref('')
|
||||||
|
|
||||||
|
function resetEmptyTitleError() {
|
||||||
|
if(newTaskTitle.value !== '') {
|
||||||
|
errorMessage.value = ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function addTask() {
|
async function addTask() {
|
||||||
if (newTaskTitle.value === '') {
|
if (newTaskTitle.value === '') {
|
||||||
errorMessage.value = t('list.create.addTitleRequired')
|
errorMessage.value = t('list.create.addTitleRequired')
|
||||||
|
|
Loading…
Reference in a new issue