diff --git a/frontend/src/components/bucket/BucketConfigForm.vue b/frontend/src/components/bucket/BucketConfigForm.vue index 418bee01..d368e3de 100644 --- a/frontend/src/components/bucket/BucketConfigForm.vue +++ b/frontend/src/components/bucket/BucketConfigForm.vue @@ -125,7 +125,7 @@ const onCancel = () => { placeholder="My Documents" help-text="Your custom display name for the storage location, shown in BCBox as a folder. Any name as you would like to see it listed in BCBox." - autofocus + focus-trap /> { const closeBucketConfig = () => { displayBucketConfig.value = false; + onDialogHide(); }; onMounted(async () => { @@ -78,10 +80,13 @@ onMounted(async () => { -

+

{{ bucketConfigTitle }}

diff --git a/frontend/src/components/bucket/BucketTable.vue b/frontend/src/components/bucket/BucketTable.vue index 86320a93..6c0a8fb7 100644 --- a/frontend/src/components/bucket/BucketTable.vue +++ b/frontend/src/components/bucket/BucketTable.vue @@ -52,6 +52,7 @@ const showSidebarInfo = async (id: number) => { }; const showBucketConfig = async (bucket: Bucket) => { + focusedElement.value = document.activeElement; emit('show-bucket-config', bucket); }; @@ -309,7 +310,6 @@ watch(getBuckets, () => { class="p-button-lg p-button-text" aria-label="Configure folder" @click="showBucketConfig(node.data)" - @keyup.enter="showBucketConfig(node.data)" > diff --git a/frontend/src/components/common/ShareButton.vue b/frontend/src/components/common/ShareButton.vue index 4005db1f..96acafb7 100644 --- a/frontend/src/components/common/ShareButton.vue +++ b/frontend/src/components/common/ShareButton.vue @@ -7,7 +7,8 @@ import { Invite, Share } from '@/components/common'; import { Button, Dialog, TabView, TabPanel } from '@/lib/primevue'; import { Permissions } from '@/utils/constants'; -import { useAuthStore, useObjectStore, usePermissionStore, useBucketStore } from '@/store'; +import { useAuthStore, useObjectStore, usePermissionStore, useBucketStore, useNavStore } from '@/store'; +import { onDialogHide } from '@/utils/utils'; import type { Ref } from 'vue'; @@ -32,6 +33,7 @@ const objectStore = useObjectStore(); const bucketStore = useBucketStore(); const { getUserId } = storeToRefs(useAuthStore()); const permissionStore = usePermissionStore(); +const { focusedElement } = storeToRefs(useNavStore()); // State const resourceType = props.objectId ? ref('object') : ref('bucket'); @@ -54,6 +56,13 @@ const hasManagePermission: Ref = computed(() => { // Dialog const displayShareDialog = ref(false); + +const showDialog = (x: boolean) => { + displayShareDialog.value = x; + if (displayShareDialog.value) { + focusedElement.value = document.activeElement; + } +};