add focus loop to tag dropdown to improve focus management

This commit is contained in:
Gregor Vostrak
2025-03-05 12:03:37 +01:00
parent 3026edd27b
commit 9948cb1fc1

View File

@@ -6,6 +6,7 @@ import TagCreateModal from '@/packages/ui/src/Tag/TagCreateModal.vue';
import MultiselectDropdownItem from '@/packages/ui/src/Input/MultiselectDropdownItem.vue';
import type { Tag } from '@/packages/api/src';
import type { Placement } from '@floating-ui/vue';
import {UseFocusTrap} from "@vueuse/integrations/useFocusTrap/component";
const props = withDefaults(
defineProps<{
@@ -177,6 +178,9 @@ const showCreateTagModal = ref(false);
<slot name="trigger"></slot>
</template>
<template #content>
<UseFocusTrap
v-if="open"
:options="{ immediate: true, allowOutsideClick: true }">
<input
ref="searchInput"
:value="searchValue"
@@ -217,6 +221,7 @@ const showCreateTagModal = ref(false);
<span>Create new Tag</span>
</button>
</div>
</UseFocusTrap>
</template>
</Dropdown>
</template>