feat: highlight hint icon when hovering the input

This commit is contained in:
kolaente 2023-04-12 18:30:59 +02:00 committed by konrad
parent abb5128426
commit 422d7fc693
2 changed files with 15 additions and 2 deletions

View File

@ -1,5 +1,5 @@
<template>
<div class="task-add">
<div class="task-add" ref="taskAdd">
<div class="add-task__field field is-grouped">
<p class="control has-icons-left is-expanded">
<textarea
@ -16,7 +16,7 @@
<span class="icon is-small is-left">
<icon icon="tasks"/>
</span>
<quick-add-magic/>
<quick-add-magic :highlight-hint-icon="taskAddHovered"/>
</p>
<p class="control">
<x-button
@ -44,6 +44,7 @@
<script setup lang="ts">
import {computed, ref} from 'vue'
import {useI18n} from 'vue-i18n'
import {useElementHover} from '@vueuse/core'
import {RELATION_KIND} from '@/types/IRelationKind'
import type {ITask} from '@/modelTypes/ITask'
@ -84,6 +85,9 @@ const taskStore = useTaskStore()
// newTaskInput.value.focus()
// })
const taskAdd = ref<HTMLTextAreaElement | null>(null)
const taskAddHovered = useElementHover(taskAdd)
const errorMessage = ref('')
function resetEmptyTitleError(e: KeyboardEvent) {

View File

@ -5,6 +5,7 @@
class="icon is-small show-helper-text"
v-tooltip="$t('task.quickAddMagic.hint')"
:aria-label="$t('task.quickAddMagic.hint')"
:class="{'is-highlighted': highlightHintIcon}"
>
<icon :icon="['far', 'circle-question']"/>
</BaseButton>
@ -104,6 +105,10 @@ import {PREFIXES} from '@/modules/parseTaskText'
const visible = ref(false)
const mode = ref(getQuickAddMagicMode())
const props = defineProps<{
highlightHintIcon: boolean,
}>()
const prefixes = computed(() => PREFIXES[mode.value])
</script>
@ -111,5 +116,9 @@ const prefixes = computed(() => PREFIXES[mode.value])
.show-helper-text {
right: 0;
pointer-events: auto !important;
&.is-highlighted {
color: inherit !important;
}
}
</style>