fix(task): make the whole task clickable #3176

Closed
konrad wants to merge 3 commits from fix/task-link-size into main
1 changed files with 13 additions and 3 deletions
Showing only changes of commit 5e9ed290ac - Show all commits

View File

@ -1,5 +1,5 @@
<template>
<div :class="{'is-loading': taskService.loading}" class="task loader-container">
<div :class="{'is-loading': taskService.loading}" class="task loader-container" @click.stop.self="openTaskDetail">
Review

This is probably not an ideal solution but I was unable to make it work without the limit to .self. It would always trigger when using the checkbox to mark a task as done.

This is probably not an ideal solution but I was unable to make it work without the limit to `.self`. It would always trigger when using the checkbox to mark a task as done.
<fancycheckbox
:disabled="(isArchived || disabled) && !canMarkAsDone"
@change="markAsDone"
@ -127,13 +127,14 @@
<script setup lang="ts">
import {ref, watch, shallowReactive, toRef, type PropType, onMounted, onBeforeUnmount, computed} from 'vue'
import {useI18n} from 'vue-i18n'
import {useRouter} from 'vue-router'
import TaskModel, { getHexColor } from '@/models/task'
import type {ITask} from '@/modelTypes/ITask'
import PriorityLabel from '@/components/tasks/partials/priorityLabel.vue'
import Labels from '@/components/tasks/partials//labels.vue'
import DeferTask from '@/components/tasks/partials//defer-task.vue'
import Labels from '@/components/tasks/partials/labels.vue'
import DeferTask from '@/components/tasks/partials/defer-task.vue'
import ChecklistSummary from '@/components/tasks/partials/checklist-summary.vue'
import User from '@/components/misc/user.vue'
@ -183,6 +184,7 @@ const props = defineProps({
const emit = defineEmits(['task-updated'])
const {t} = useI18n({useScope: 'global'})
const router = useRouter()
const taskService = shallowReactive(new TaskService())
const task = ref<ITask>(new TaskModel())
@ -272,6 +274,14 @@ function hideDeferDueDatePopup(e) {
showDefer.value = false
})
}
const taskLink = ref(null)
function openTaskDetail() {
const isTextSelected = window.getSelection().toString()
if (!isTextSelected) {
router.push(taskDetailRoute.value)
Review

Because just calling click() on the a element itself would trigger this event handler again I restored to pushing the route directly.

Because just calling `click()` on the `a` element itself would trigger this event handler again I restored to pushing the route directly.
}
}
</script>
<style lang="scss" scoped>