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

Vue removes aria-attributes that evaluate to false #2956

Closed
obulat opened this issue Sep 1, 2023 · 2 comments
Closed

Vue removes aria-attributes that evaluate to false #2956

obulat opened this issue Sep 1, 2023 · 2 comments
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

Comments

@obulat
Copy link
Contributor

obulat commented Sep 1, 2023

Description

The search bar in the header of the search page has a role of combobox. It has to have aria-expanded="false" in collapsed state. However, Vue removes the attribute if the values evaluates to false1.

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:

:aria-expanded="`${isRecentVisible}`"

:aria-expanded="`${showRecentSearches}`"

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:

Typically, the initial state of a combobox is collapsed, with aria-expanded="false" set. In the collapsed state, only the combobox element and, optionally a sibling button to invoke the popup, are visible. The aria-expanded, with the value set to false, is required when collapsed, because it indicates to assistive technologies that the widget is expandable.

Footnotes

  1. Bind boolean values to accessibility attributes

@obulat obulat added 🟨 priority: medium Not blocking but should be addressed soon 🛠 goal: fix Bug fix ♿️ aspect: a11y Concerns related to the project's accessibility 🧱 stack: frontend Related to the Nuxt frontend labels Sep 1, 2023
@dhruvkb
Copy link
Member

dhruvkb commented Sep 2, 2023

This was apparently fixed in Vue 3. #411 can't come soon enough.

@obulat obulat added good first issue New-contributor friendly help wanted Open to participation from the community 🔧 tech: vue Involves Vue.js labels Sep 23, 2023
@AetherUnbound AetherUnbound added the ⛔ status: blocked Blocked & therefore, not ready for work label Jan 4, 2024
@obulat
Copy link
Contributor Author

obulat commented Jul 31, 2024

Closing this issue as the Nuxt 3 migration has fixed it.
However, it is necessary to audit the properties that should be removed instead of having =false value in other components.

@obulat obulat closed this as completed Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
Archived in project
Development

No branches or pull requests

3 participants