Skip to content

Commit

Permalink
fix: use aria-posinset to give screen readers an orientation of where…
Browse files Browse the repository at this point in the history
… they are in the dynamic list

Signed-off-by: Wolfgang <[email protected]>
  • Loading branch information
wofferl committed Nov 28, 2024
1 parent f3f4db2 commit a5a97e4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/feed-display/FeedItemDisplayList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@
:fetch-key="fetchKey"
@load-more="fetchMore()">
<template v-if="items && items.length > 0">
<template v-for="item in filteredItemcache">
<template v-for="(item, index) in filteredItemcache">
<FeedItemRow :key="item.id"
:ref="'feedItemRow' + item.id"
:item-count="filteredItemcache.length"
:item-index="index + 1"
:item="item"
:class="{ 'active': selectedItem && selectedItem.id === item.id }"
@show-details="$emit('show-details')" />
Expand Down
10 changes: 10 additions & 0 deletions src/components/feed-display/FeedItemRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<li class="feed-item-row"
:class="{ 'compact': compactMode }"
:aria-label="item.title"
:aria-setsize="itemCount"
:aria-posinset="itemIndex"
@click="select()">
<ShareItem v-if="showShareMenu" :item-id="shareItem" @close="closeShareMenu()" />
<div class="link-container">
Expand Down Expand Up @@ -111,6 +113,14 @@ export default Vue.extend({
type: Object,
required: true,
},
itemCount: {
type: Number,
required: true,
},
itemIndex: {
type: Number,
required: true,
},
},
data: () => {
return {
Expand Down

0 comments on commit a5a97e4

Please sign in to comment.