Skip to content

Commit

Permalink
fix: correct implementation of accesssible text for vertical result c…
Browse files Browse the repository at this point in the history
…ounts

The current implementation of verticalresultcount.hbs unnecessarily uses
an aria-label and aria-hidden property to handle text that is already
accessible for a non-interactive element.

J=TECHOPS-9030
  • Loading branch information
benmcginnis committed May 17, 2023
1 parent ad4a9ba commit 5e21825
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yext/answers-search-ui",
"version": "1.16.0",
"version": "1.16.1",
"description": "Javascript Search Programming Interface",
"main": "dist/answers-umd.js",
"repository": {
Expand Down
15 changes: 6 additions & 9 deletions src/ui/templates/results/verticalresultscount.hbs
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
{{#unless isHidden}}
<div class="yxt-VerticalResultsCount"
aria-label="{{translate phrase='[[start]] through [[end]] of [[resultsCount]]' start=pageStart end=pageEnd resultsCount=total }}">
<div aria-hidden="true">
<div class="yxt-VerticalResultsCount">
{{translate
phrase=
'<span class="yxt-VerticalResultsCount-start">[[start]]</span>
<span class="yxt-VerticalResultsCount-dash">-</span>
<span class="yxt-VerticalResultsCount-end">[[end]]</span>
<span class="yxt-VerticalResultsCount-of">of</span>
<span class="yxt-VerticalResultsCount-total">[[resultsCount]]</span>'
'<span class="yxt-VerticalResultsCount-start">[[start]]</span>
<span class="yxt-VerticalResultsCount-dash">-</span>
<span class="yxt-VerticalResultsCount-end">[[end]]</span>
<span class="yxt-VerticalResultsCount-of">of</span>
<span class="yxt-VerticalResultsCount-total">[[resultsCount]]</span>'
context='Example: 1-10 of 50'
start=pageStart
end=pageEnd
resultsCount=total
}}
</div>
</div>
{{/unless}}

0 comments on commit 5e21825

Please sign in to comment.