fix(task): make the whole task clickable #3176
No reviewers
Labels
No Label
area/internal-code
changes requested
confirmed
dependencies
duplicate
good first issue
help wanted
hosting
invalid
kind/bug
kind/feature
question
wontfix
No Milestone
No project
No Assignees
3 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vikunja/frontend#3176
Loading…
Reference in New Issue
No description provided.
Delete Branch "fix/task-link-size"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
As discussed, this PR uses the approach from here to make the whole tasks in a list of tasks clickable.
Resolves #3172
@ -4,3 +2,1 @@
:class="{'is-loading': taskService.loading}"
class="task loader-container"
>
<div :class="{'is-loading': taskService.loading}" class="task loader-container" @click.stop.self="openTaskDetail">
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.@ -278,0 +279,4 @@
function openTaskDetail() {
const isTextSelected = window.getSelection().toString()
if (!isTextSelected) {
router.push(taskDetailRoute.value)
Because just calling
click()
on thea
element itself would trigger this event handler again I restored to pushing the route directly.I'm not so happy with this solution either since we still have nested links / buttons.
I tried to rework this some time last year but never pushed the branch since there were some problems.
I don't remember what exactly was the issue but I think it was more a merge issue / I realised I should work on something more important than this change instead.Edit: I remembered now: we were moving the whole project to vues script setup. That branch is still based on object components. A rebase might be possible though.Maybe we could solve this issue based on that branch. It might even be that I solved the 'whole task clickable' issue it in that branch already—I don't remember.
Okay so better do this once and for all?
I only tried to fix the "only the task title is clickable" problem but you're right
That was the idea. Maybe we should even abstract the part with the clickable background. Because we could use the same code also in the sidebar and for the namespace/project teasers.
@ -7,7 +7,7 @@
@change="(event: Event) => updateData((event.target as HTMLInputElement).checked)"
type="checkbox"
/>
<label :for="checkBoxId" class="check" @click.prevent="check">
FYI
@click.prevent="check"
doesn't respect the checkbox being disabled, so yep, needs to be removed. Perhaps in a separate MR in case we don't have enough time for this one.konrad referenced this pull request2023-09-06 16:33:25 +00:00
Closing this, see #3172 (comment)