fix(list): automatically close task edit pane when switching between lists

Resolves https://kolaente.dev/vikunja/frontend/issues/2442
This commit is contained in:
kolaente 2022-09-30 21:13:13 +02:00
parent 266f877455
commit 72b731d620
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -118,7 +118,7 @@
v-if="isTaskEdit" v-if="isTaskEdit"
class="taskedit mt-0" class="taskedit mt-0"
:title="$t('list.list.editTask')" :title="$t('list.list.editTask')"
@close="() => isTaskEdit = false" @close="closeTaskEditPane()"
:shadow="false" :shadow="false"
:task="taskEditTask" :task="taskEditTask"
/> />
@ -139,7 +139,7 @@ export default { name: 'List' }
</script> </script>
<script setup lang="ts"> <script setup lang="ts">
import {ref, computed, toRef, nextTick, onMounted, type PropType} from 'vue' import {ref, computed, toRef, nextTick, onMounted, type PropType, watch} from 'vue'
import draggable from 'zhyswan-vuedraggable' import draggable from 'zhyswan-vuedraggable'
import {useRoute, useRouter} from 'vue-router' import {useRoute, useRouter} from 'vue-router'
@ -203,6 +203,16 @@ const DRAG_OPTIONS = {
const taskEditTask = ref<ITask | null>(null) const taskEditTask = ref<ITask | null>(null)
const isTaskEdit = ref(false) const isTaskEdit = ref(false)
function closeTaskEditPane() {
isTaskEdit.value = false
taskEditTask.value = null
}
watch(
() => props.listId,
closeTaskEditPane,
)
const { const {
tasks, tasks,
loading, loading,