From 78b765ddc4a27800b8e86396e2a64034c27bc301 Mon Sep 17 00:00:00 2001 From: kolaente Date: Fri, 4 Nov 2022 13:00:04 +0100 Subject: [PATCH] fix(kanban): don't allow dragging a bucket if a task input is focused Resolves https://kolaente.dev/vikunja/frontend/issues/2452 --- src/views/list/ListKanban.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/views/list/ListKanban.vue b/src/views/list/ListKanban.vue index 9d33d7b41..8d77c9e33 100644 --- a/src/views/list/ListKanban.vue +++ b/src/views/list/ListKanban.vue @@ -24,7 +24,7 @@ @end="updateBucketPosition" @start="() => dragBucket = true" group="buckets" - :disabled="!canWrite" + :disabled="!canWrite || newTaskInputFocused" tag="ul" :item-key="({id}) => `bucket${id}`" :component-data="bucketDraggableComponentData" @@ -142,6 +142,7 @@ class="input" :disabled="loading || taskLoading || undefined" @focusout="toggleShowNewTaskInput(bucket.id)" + @focusin="() => newTaskInputFocused = true" @keyup.enter="addTaskToBucket(bucket.id)" @keyup.esc="toggleShowNewTaskInput(bucket.id)" :placeholder="$t('list.kanban.addTaskPlaceholder')" @@ -294,6 +295,7 @@ export default defineComponent({ newTaskError: {}, showSetLimitInput: false, collapsedBuckets: {}, + newTaskInputFocused: false, // We're using this to show the loading animation only at the task when updating it taskUpdating: {}, @@ -462,6 +464,7 @@ export default defineComponent({ toggleShowNewTaskInput(bucketId) { this.showNewTaskInput[bucketId] = !this.showNewTaskInput[bucketId] + this.newTaskInputFocused = false }, async addTaskToBucket(bucketId) {