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

[Feature Request]: Improve Select accessibility #686

Closed
AykutSarac opened this issue Aug 29, 2023 · 5 comments · Fixed by #856
Closed

[Feature Request]: Improve Select accessibility #686

AykutSarac opened this issue Aug 29, 2023 · 5 comments · Fixed by #856
Assignees
Labels
a11y Accessibility related issues bl-select Select Component good first issue Good for newcomers

Comments

@AykutSarac
Copy link
Member

Describe the problem or use case

Noticed while using select component for city selection. I wanted to focus directly to the city starting with X, so I pressed to X key however it didn't focus/scroll to it.

Proposed solution

Should focus to the select option starting with the pressed key

Alternatives considered

No response

Additional technical context

Additionally it might listen for other keys while select visible and match the ongoing characters like XY...

@AykutSarac AykutSarac added a11y Accessibility related issues bl-select Select Component labels Aug 29, 2023
@AykutSarac
Copy link
Member Author

This should be discussed though whether this should be implemented along with Search functionality or separately, as I was thinking a key press may trigger focus into the search input.

@muratcorlu
Copy link
Contributor

This can be considered for the

This should be discussed though whether this should be implemented along with Search functionality or separately, as I was thinking a key press may trigger focus into the search input.

Good point. I think jumping to the option by writing a name still can be a good improvement when the search is not enabled. But indeed, this can be considered with #265.

@AykutSarac AykutSarac added the good first issue Good for newcomers label Feb 19, 2024
@gokcecicek gokcecicek self-assigned this Apr 3, 2024
@gokcecicek
Copy link
Contributor

gokcecicek commented Apr 26, 2024

Select Accessibility (ADR)

This improvement aims to enable users to access bl-select-option elements more easily using the keyboard.

Rules

  • This feature does not work with search-bar attribute.
  • When a character is pressed on the keyboard, if there is an option starting with that character among the bl-select-option elements, that option will be focused automatically.
  • When characters are pressed consecutively on the keyboard, the first option starting with those characters will be focus.
  • The threshold for consecutive key presses is 500.
  • If the target option is disabled, it will not be focus when attempting to access it via keyboard.
  • Comparisons are case-insensitive.

@AykutSarac
Copy link
Member Author

  • Do we need an attribute for key-press-threshold for customization, or a fixed value isn't sufficient? If there are cases that requires to set custom threshold can you include it in the ADR?
  • Is there a limit on the number of characters allowed for consecutive submissions?
  • Maybe we can mention that the key presses will be compared case-insensitive?

@gokcecicek
Copy link
Contributor

  • I don't have a specific case in mind. I added the key-press-threshold attribute to provide more flexibility. I was undecided about this matter, embedding it as 500 directly into the code seems reasonable. We can add it as a prop later if needed
  • There is no char limit for consecutive submissions
  • You're right! That should provide clarity for anyone reviewing the ADR. I added to ADR that it works case-insensitive.

buseselvi pushed a commit that referenced this issue May 9, 2024
This PR allows users to easily access target option based on their
keyboard input.

Closes [#686](#686)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y Accessibility related issues bl-select Select Component good first issue Good for newcomers
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants