Skip to content

Commit

Permalink
Merge pull request #197 from bcgov/SC3659
Browse files Browse the repository at this point in the history
Replace table role with treegird for screenreader
  • Loading branch information
TimCsaky authored May 15, 2024
2 parents 0d51350 + 3fbc4b8 commit 9b0f424
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
6 changes: 6 additions & 0 deletions frontend/src/assets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@ a button:focus-visible {
}
}

table tbody,
table tbody tr td:focus-visible{
outline: 0 none;
box-shadow: inset 0px 0px 0 0.2rem #a6d5fa;
}

.p-column-title {
font-weight: bold;
}
Expand Down
11 changes: 8 additions & 3 deletions frontend/src/components/bucket/BucketList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ onMounted(async () => {
<div class="flex flex-wrap">
<div class="flex-grow-1">
<h1 class="">My files</h1>
<h4 class="mb-4">Select a folder to view the files inside it.</h4>
<h4
id="tree_label"
class="mb-4"
>
Select a folder to view the files inside it.
</h4>
</div>
<div class="flex-none align-items-right">
Expand Down Expand Up @@ -99,8 +104,8 @@ onMounted(async () => {
>
NRIDS Optimization
</a>
(Natural Resource ministries) or your ministry's service desk if you
need help with &quot;bucket&quot; storage location sources.
(Natural Resource ministries) or your ministry's service desk if you need help with &quot;bucket&quot; storage
location sources.
</Message>
<Message severity="warn">
Expand Down
18 changes: 18 additions & 0 deletions frontend/src/components/bucket/BucketTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ const permissionsVisible: Ref<boolean> = ref(false);
const permissionsBucketId: Ref<string> = ref('');
const permissionBucketName: Ref<string> = ref('');
const treeData: Ref<Array<BucketTreeNode>> = ref([]);
const tableProps = {
role: 'treegrid',
'aria-describedby': 'tree_label',
'aria-readonly': true
};
const columnProps = {
bodyCell: () => ({
role: 'treeitem',
tabindex: 0
})
};
const emit = defineEmits(['show-bucket-config', 'show-sidebar-info']);
Expand Down Expand Up @@ -242,6 +253,12 @@ watch(getBuckets, () => {
:rows-per-page-options="[10, 20, 50]"
sort-field="bucketName"
:sort-order="1"
:table-props="tableProps"
:pt="{
tbody: () => ({
tabindex: 0
})
}"
>
<template #empty>
<div
Expand All @@ -260,6 +277,7 @@ watch(getBuckets, () => {
header-style="padding-left: 50px"
body-class="truncate"
expander
:pt="columnProps"
>
<template #body="{ node }">
<span class="row-head mr-2">
Expand Down

0 comments on commit 9b0f424

Please sign in to comment.