forked from vikunja/frontend
Fix focus on new task
This commit is contained in:
parent
714c01403c
commit
15b5ad9d84
|
@ -64,19 +64,16 @@
|
||||||
<add-task
|
<add-task
|
||||||
:listId="Number($route.params.listId)"
|
:listId="Number($route.params.listId)"
|
||||||
@taskAdded="updateTaskList"
|
@taskAdded="updateTaskList"
|
||||||
|
ref="newTaskInput"
|
||||||
/>
|
/>
|
||||||
<p class="help is-danger" v-if="showError && newTaskText === ''">
|
<p class="help is-danger" v-if="showError && newTaskText === ''">
|
||||||
Please specify a list title.
|
Please specify a list title.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nothing
|
<nothing v-if="ctaVisible && tasks.length === 0 && !taskCollectionService.loading">
|
||||||
v-if="
|
|
||||||
ctaVisible && tasks.length === 0 && !taskCollectionService.loading
|
|
||||||
"
|
|
||||||
>
|
|
||||||
This list is currently empty.
|
This list is currently empty.
|
||||||
<a @click="$refs.newTaskInput.focus()">Create a new task.</a>
|
<a @click="focusNewTaskInput()">Create a new task.</a>
|
||||||
</nothing>
|
</nothing>
|
||||||
|
|
||||||
<div class="tasks-container">
|
<div class="tasks-container">
|
||||||
|
@ -228,6 +225,9 @@ export default {
|
||||||
this.isTaskEdit = false
|
this.isTaskEdit = false
|
||||||
this.loadTasks(page, search)
|
this.loadTasks(page, search)
|
||||||
},
|
},
|
||||||
|
focusNewTaskInput() {
|
||||||
|
this.$refs.newTaskInput.$refs.newTaskInput.focus()
|
||||||
|
},
|
||||||
updateTaskList(task) {
|
updateTaskList(task) {
|
||||||
this.tasks.push(task)
|
this.tasks.push(task)
|
||||||
this.sortTasks()
|
this.sortTasks()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user