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

QMenus Are Not Compatible with QLists and QItems by Default #17162

Open
gmeben opened this issue May 4, 2024 · 0 comments
Open

QMenus Are Not Compatible with QLists and QItems by Default #17162

gmeben opened this issue May 4, 2024 · 0 comments
Labels
area/a11y Accessibility area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite kind/bug 🐞 Qv2 🔝 Quasar v2 issues

Comments

@gmeben
Copy link
Contributor

gmeben commented May 4, 2024

What happened?

The documentation for QMenu currently states:

Goes very well with QList as dropdown content, but it’s by no means limited to it.

Using axe DevTools to test a Basic QMenu as shown in the documentation reveals that elements with role=list (QList) as child elements of elements with role=menu (QMenu) violates WCAG Success Criteria 1.3.1: Info and Relationships.

Removing the QList component from QMenu then reveals another violation of WCAG Success Criteria 1.3.1: Info and Relationships.

A workaround in the meantime is to add role="menuitem attributes to each of the QItem elements contained within the QMenu. The fact that these attributes have to be added individually to each QItem element in order to avoid a WCAG Success Criteria violation indicates a failure within the design of QMenu that needs to be redressed by maintainers.

What did you expect to happen?

Usages of QItem within QMenu should have role="menuitem" attributes automatically applied by default to avoid WCAG Success Criteria violations.

Reproduction URL

https://codepen.io/quadbaup/pen/KKYExVq

How to reproduce?

  1. Using Chrome 124 with axe DevTools installed, visit this CodePen of a QMenu with a QList: https://codepen.io/quadbaup/pen/KKYExVq
  2. Ensure you're authenticated on CodePen
  3. Click the Change View button and choose Debug mode
  4. Click the "Basic Menu" button to reveal the QMenu
  5. Open Chrome Developer Tools, open the axe DevTools tab, and click "Scan ALL of my page"
  6. Note the issues detected, particularly Element has children which are not allowed: [role=list]
  7. Visit this CodePen of a QMenu with no QList and repeat steps 2 through 5: https://codepen.io/quadbaup/pen/vYMqbjN
  8. Note the issues detected, particularly Required ARIA parent role not present: list
  9. Visit this CodePen of a QMenu where each QItem has a role="menuitem" attribute and repeat steps 2 through 5: https://codepen.io/quadbaup/pen/mdgZvvr
  10. Note there are no issues detected

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Components (quasar)

Platforms/Browsers

Chrome

Quasar info output

No response

Relevant log output

No response

Additional context

No response

@gmeben gmeben added kind/bug 🐞 Qv2 🔝 Quasar v2 issues labels May 4, 2024
@github-actions github-actions bot added area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite labels May 4, 2024
@yusufkandemir yusufkandemir added the area/a11y Accessibility label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/a11y Accessibility area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite kind/bug 🐞 Qv2 🔝 Quasar v2 issues
Projects
None yet
Development

No branches or pull requests

2 participants