Vue removes aria-attributes that evaluate to false
#2956
Labels
♿️ aspect: a11y
Concerns related to the project's accessibility
🛠 goal: fix
Bug fix
good first issue
New-contributor friendly
help wanted
Open to participation from the community
🟨 priority: medium
Not blocking but should be addressed soon
🧱 stack: frontend
Related to the Nuxt frontend
⛔ status: blocked
Blocked & therefore, not ready for work
🔧 tech: vue
Involves Vue.js
Description
The search bar in the header of the search page has a role of
combobox
. It has to havearia-expanded="false"
in collapsed state. However, Vue removes the attribute if the values evaluates tofalse
1.To overcome this, we must convert the values for boolean aria attributes to strings.
Here are the places where search bar
aria-expanded
needs to be fixed:openverse/frontend/src/components/VHeader/VSearchBar/VSearchBar.vue
Line 27 in 2e96028
openverse/frontend/src/components/VHeader/VHeaderMobile/VHeaderMobile.vue
Line 56 in 2e96028
There probably are other places, too, where
aria-expanded
should be fixed.Reproduction
Run the lighthouse A11y check on the search page, and you will see this issue reported.
Additional context
Mdn article states that the attribute is mandatory when the combobox is collapsed:
Footnotes
Bind boolean values to accessibility attributes ↩
The text was updated successfully, but these errors were encountered: