Skip to content

Commit e141c47

Browse files
committed
fix(a11y): remove incorrect aria-disabled, hide separator and update i18n schema
1 parent 15e12c6 commit e141c47

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed

app/components/Compare/FacetSelector.vue

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ function getCategoryActiveControl(category: string): 'all' | 'none' {
3232
function handleCategoryControlKeydown(category: string, event: KeyboardEvent): void {
3333
const { key } = event
3434
35-
if (key === 'Enter') {
36-
event.preventDefault()
37-
return
38-
}
39-
4035
if (!['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(key)) return
4136
4237
event.preventDefault()
@@ -94,7 +89,6 @@ function handleCategoryControlKeydown(category: string, event: KeyboardEvent): v
9489
<ButtonBase
9590
role="radio"
9691
:aria-checked="isCategoryAllSelected(category)"
97-
:aria-disabled="isCategoryAllSelected(category)"
9892
:tabindex="getCategoryActiveControl(category) === 'all' ? 0 : -1"
9993
data-radio-type="all"
10094
@keydown="handleCategoryControlKeydown(category, $event)"
@@ -103,11 +97,10 @@ function handleCategoryControlKeydown(category: string, event: KeyboardEvent): v
10397
>
10498
{{ $t('compare.facets.all') }}
10599
</ButtonBase>
106-
<span class="text-2xs text-fg-muted/40">/</span>
100+
<span class="text-2xs text-fg-muted/40" aria-hidden="true">/</span>
107101
<ButtonBase
108102
role="radio"
109103
:aria-checked="isCategoryNoneSelected(category)"
110-
:aria-disabled="isCategoryNoneSelected(category)"
111104
:tabindex="getCategoryActiveControl(category) === 'none' ? 0 : -1"
112105
data-radio-type="none"
113106
@keydown="handleCategoryControlKeydown(category, $event)"

i18n/schema.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3247,12 +3247,6 @@
32473247
"deselect_all": {
32483248
"type": "string"
32493249
},
3250-
"select_category": {
3251-
"type": "string"
3252-
},
3253-
"deselect_category": {
3254-
"type": "string"
3255-
},
32563250
"binary_only_tooltip": {
32573251
"type": "string"
32583252
},

test/nuxt/components/compare/FacetSelector.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ describe('FacetSelector', () => {
179179
const component = await mountSuspended(FacetSelector)
180180

181181
// Find a facet button (not all/none)
182-
const facetButton = component.findAll('button').find(b => b.text().includes('Downloads'))
182+
const facetButton = component
183+
.findAll('button[role="checkbox"]')
184+
.find(b => b.text().includes('Downloads'))
183185
await facetButton?.trigger('click')
184186

185187
expect(mockToggleFacet).toHaveBeenCalled()

0 commit comments

Comments
 (0)