fix type errors

This commit is contained in:
Gregor Vostrak
2024-03-11 18:32:54 +01:00
parent a0e729fde5
commit 72f6cb2bdf
3 changed files with 5 additions and 4 deletions

View File

@@ -97,7 +97,7 @@ async function onToggleButtonPress(newState: boolean) {
} }
} }
const currentProject = ref<Project | null>(null); const currentProject = ref<Project>();
watch(currentProject, () => { watch(currentProject, () => {
if (currentProject.value) { if (currentProject.value) {
currentTimeEntry.value.project_id = currentProject.value.id; currentTimeEntry.value.project_id = currentProject.value.id;

View File

@@ -20,8 +20,8 @@ import { getRandomColor } from '@/utils/color';
const searchValue = ref(''); const searchValue = ref('');
const searchInput = ref<HTMLElement | null>(null); const searchInput = ref<HTMLElement | null>(null);
const model = defineModel<Project | null>({ const model = defineModel<Project>({
default: null, default: undefined,
}); });
const open = ref(false); const open = ref(false);
const projectsStore = useProjectsStore(); const projectsStore = useProjectsStore();
@@ -63,6 +63,7 @@ async function addProjectIfNoneExists() {
watch(open, (isOpen) => { watch(open, (isOpen) => {
if (isOpen) { if (isOpen) {
nextTick(() => { nextTick(() => {
// @ts-expect-error We need to access the actual HTML Element to focus as radix-vue does not support any other way right now
searchInput.value?.$el?.focus(); searchInput.value?.$el?.focus();
}); });

View File

@@ -164,7 +164,7 @@ function updateValue(e: string[]) {
<ComboboxRoot <ComboboxRoot
multiple multiple
:open="open" :open="open"
@update:modelValue="updateValue" @update:modelValue="updateValue as any"
v-model:searchTerm="searchValue" v-model:searchTerm="searchValue"
class="relative"> class="relative">
<ComboboxAnchor> <ComboboxAnchor>