diff --git a/src/components/tasks/partials/singleTaskInProject.vue b/src/components/tasks/partials/singleTaskInProject.vue
index 980b97175..f229b8810 100644
--- a/src/components/tasks/partials/singleTaskInProject.vue
+++ b/src/components/tasks/partials/singleTaskInProject.vue
@@ -3,7 +3,10 @@
(null)
+const taskContainerRef = ref(null)
-function openTaskDetail() {
+function hasTextSelected() {
const isTextSelected = window.getSelection().toString()
- if (!isTextSelected) {
+ return !(typeof isTextSelected === 'undefined' || isTextSelected === '' || isTextSelected === '\n')
+}
+
+function openTaskDetail() {
+ if (!hasTextSelected()) {
taskLink.value.$el.click()
}
}
+
+function focusTaskLink() {
+ if (!hasTextSelected()) {
+ taskContainerRef.value.focus()
+ }
+}