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

Clickable items added in the before-options slot in q-select are not accessible via keyboard #17344

Open
chrisnruud opened this issue Jul 1, 2024 · 2 comments
Labels
area/a11y Accessibility area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/vite-plugin Bugs related to Vite usage with Quasar kind/bug 🐞 Qv2 🔝 Quasar v2 issues

Comments

@chrisnruud
Copy link

What happened?

I have a q-select with a multitude of options , and a clickable q-item in the before-options - slot that selects ot deselects all the options in the dropdown. When I do my wcag testing, this item is excluded from the navigation on up-down in the selection dropdown, and is not accessible using tab or other combinations (as in q-btn-dropdown)

What did you expect to happen?

when a clickable item is put in the before-options or after-options slot in the q-select component, this item should be accessible using the normal keyboard navigation in the component, or as a last resort, be accessible through tab or another key.

Reproduction URL

https://codepen.io/chrisnruud/pen/WNBqWrp

How to reproduce?

  1. Open the codepen
  2. expand the selection drop down using whichever method
  3. try to reach the clickable item at the top using only the keyboard
  4. :(

Flavour

Vite Plugin (@quasar/vite-plugin)

Areas

Components (quasar), Accessibility [a11y] (quasar)

Platforms/Browsers

Firefox

Quasar info output

NOt using quasar cli

Relevant log output

No response

Additional context

No response

@chrisnruud chrisnruud added kind/bug 🐞 Qv2 🔝 Quasar v2 issues labels Jul 1, 2024
@github-actions github-actions bot added area/a11y Accessibility area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/vite-plugin Bugs related to Vite usage with Quasar labels Jul 1, 2024
@RamonDonadeu
Copy link

After checking the code and "in code" examples, it seems like what you are trying to do is not the expected behavior of "after-options \ before-options"

From Q-Select page:
Template slot for the elements that should be rendered before the list of options.

Here it says, "before THE LIST", not before the other options in the list. Maybe it should be clarified in docs.

And looking at the code, the keydown event just iterates between items in the "option" value. Anyway, why would you need to add an option in "Before-options" slot to act as an option? I imagine it could be something like... "create new option".
In that case, I would just add it to options array and onClick check if the selection option is "create new option" and do the next actions.

It could be an interesting addition to the slots of q-select.

@chrisnruud
Copy link
Author

We are using this slot as a "select all/ deselect all" button - option, and if this is not available for keyboard navigation, it brteaks wcag navigation compliance. If this is misuse of this slot I don't know, but this is useful

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/vite-plugin Bugs related to Vite usage with Quasar kind/bug 🐞 Qv2 🔝 Quasar v2 issues
Projects
None yet
Development

No branches or pull requests

2 participants