fix that timetracker duration popover instantly closes on click if another element was focused before

This commit is contained in:
Gregor Vostrak
2025-05-20 16:06:00 +02:00
parent 4635fec016
commit 915204f7a6

View File

@@ -101,15 +101,19 @@ const startTime = computed(() => {
const inputField = ref<HTMLInputElement | null>(null);
const timeRangeSelector = ref<HTMLElement | null>(null);
const isMouseDown = ref(false);
function openModalOnTab(e: FocusEvent) {
// check if the source is inside the dropdown
console.log(e.target);
const source = e.relatedTarget as HTMLElement;
if (
source &&
window.document.body
.querySelector<HTMLElement>('#app')
?.contains(source)
?.contains(source) &&
!isMouseDown.value
) {
open.value = true;
}
@@ -153,6 +157,8 @@ function closeAndFocusInput() {
@keydown.exact.tab="focusNextElement"
@keydown.exact.shift.tab="open = false"
@blur="updateTimerAndStartLiveTimerUpdate"
@mousedown="isMouseDown = true"
@mouseup="isMouseDown = false"
@keydown.enter="onTimeEntryEnterPress" />
</template>
<template #content>