Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace table role with treegird for screenreader #197

Merged
merged 1 commit into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading