mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-04-25 06:35:32 +00:00
fix: multiselect clear button now properly clears the value (#2067)
Fixes #2045
This commit is contained in:
@@ -321,6 +321,13 @@ function handleFocus() {
|
|||||||
|
|
||||||
function select(object: T | null) {
|
function select(object: T | null) {
|
||||||
if (object === null) {
|
if (object === null) {
|
||||||
|
// Handle clearing the value
|
||||||
|
if (!props.multiple) {
|
||||||
|
internalValue.value = null
|
||||||
|
query.value = ''
|
||||||
|
emit('update:modelValue', null)
|
||||||
|
closeSearchResults()
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
label="title"
|
label="title"
|
||||||
:select-placeholder="$t('project.searchSelect')"
|
:select-placeholder="$t('project.searchSelect')"
|
||||||
:model-value="project"
|
:model-value="project"
|
||||||
@update:modelValue="Object.assign(project, $event)"
|
@update:modelValue="(val) => val === null ? select(null) : Object.assign(project, val)"
|
||||||
@select="select"
|
@select="select"
|
||||||
@search="findProjects"
|
@search="findProjects"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -546,12 +546,16 @@ function useAvailableTimezones(settingsRef: Ref<IUserSettings>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const timezoneObject = computed({
|
const timezoneObject = computed({
|
||||||
get: () => ({
|
get: () => ({
|
||||||
value: settingsRef.value.timezone,
|
value: settingsRef.value.timezone,
|
||||||
label: settingsRef.value.timezone?.replace(/_/g, ' '),
|
label: settingsRef.value.timezone?.replace(/_/g, ' '),
|
||||||
}),
|
}),
|
||||||
set: (obj) => {
|
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
|
settingsRef.value.timezone = obj.value
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user