diff --git a/frontend/src/components/input/Multiselect.vue b/frontend/src/components/input/Multiselect.vue index 187cb23d1..5b753dbeb 100644 --- a/frontend/src/components/input/Multiselect.vue +++ b/frontend/src/components/input/Multiselect.vue @@ -321,6 +321,13 @@ function handleFocus() { function select(object: T | null) { if (object === null) { + // Handle clearing the value + if (!props.multiple) { + internalValue.value = null + query.value = '' + emit('update:modelValue', null) + closeSearchResults() + } return } diff --git a/frontend/src/components/tasks/partials/ProjectSearch.vue b/frontend/src/components/tasks/partials/ProjectSearch.vue index b75f1bcf8..96808dfeb 100644 --- a/frontend/src/components/tasks/partials/ProjectSearch.vue +++ b/frontend/src/components/tasks/partials/ProjectSearch.vue @@ -6,7 +6,7 @@ label="title" :select-placeholder="$t('project.searchSelect')" :model-value="project" - @update:modelValue="Object.assign(project, $event)" + @update:modelValue="(val) => val === null ? select(null) : Object.assign(project, val)" @select="select" @search="findProjects" > diff --git a/frontend/src/views/user/settings/General.vue b/frontend/src/views/user/settings/General.vue index f5e852aec..6ee11b668 100644 --- a/frontend/src/views/user/settings/General.vue +++ b/frontend/src/views/user/settings/General.vue @@ -546,12 +546,16 @@ function useAvailableTimezones(settingsRef: Ref) { } const timezoneObject = computed({ - get: () => ({ - value: settingsRef.value.timezone, - label: settingsRef.value.timezone?.replace(/_/g, ' '), + get: () => ({ + value: settingsRef.value.timezone, + label: settingsRef.value.timezone?.replace(/_/g, ' '), }), set: (obj) => { - if (obj && typeof obj === 'object' && 'value' in obj) { + if (obj === null) { + settingsRef.value.timezone = '' + return + } + if (typeof obj === 'object' && 'value' in obj) { settingsRef.value.timezone = obj.value } },