fix: remove debounce from color picker to prevent stale color on save

The color picker had a 500ms debounce before propagating the selected
color to the parent component. Since all usages save via an explicit
button click (not automatically), the debounce only caused a race
condition where the model value could be stale when the user clicked
Save within 500ms of picking a color.

Closes go-vikunja/vikunja#2312
This commit is contained in:
kolaente
2026-03-10 23:18:07 +01:00
parent f497e8bb6d
commit d196af0503

View File

@@ -82,7 +82,6 @@ const DEFAULT_COLORS = [
]
const color = ref('')
const lastChangeTimeout = ref<ReturnType<typeof setTimeout> | null>(null)
const defaultColors = ref(DEFAULT_COLORS)
const colorListID = ref(createRandomID())
@@ -112,13 +111,7 @@ function update(force = false) {
return
}
if (lastChangeTimeout.value !== null) {
clearTimeout(lastChangeTimeout.value)
}
lastChangeTimeout.value = setTimeout(() => {
model.value = color.value
}, 500)
model.value = color.value
}
function reset() {