fix TimeTrackerRangeSelector detection so it does not open the Dropdown again after pressing Escape

This commit is contained in:
Gregor Vostrak
2025-01-29 15:38:22 +01:00
parent a8318a458e
commit 71ec1e9e0f

View File

@@ -139,7 +139,12 @@ const timeRangeSelector = ref<HTMLElement | null>(null);
function openModalOnTab(e: FocusEvent) {
// check if the source is inside the dropdown
const source = e.relatedTarget as HTMLElement;
if (source && window.document.body.contains(source)) {
if (
source &&
window.document.body
.querySelector<HTMLElement>('#app')
?.contains(source)
) {
open.value = true;
}
}