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

WICKET-7131 Improved accessibility and screen reader support #1034

Merged
merged 3 commits into from
Nov 19, 2024

Conversation

strido
Copy link
Contributor

@strido strido commented Nov 15, 2024

Improved accessibility support with the following changes

  • The up and down arrow keys in the auto-complete dropdown should not move the cursor to the start or end of the text field
  • aria-expanded should be set on the input element to indicate whether the dropdown is expanded or collapsed
  • aria-selected should be set on the element that is currently selected in the dropdown
  • aria-activedescendant attribute should be used on the input field, pointing to the currently selected item in the dropdown. This allows screen readers to track the active selection in the list.
  • aria-live should not be set on the dropdown as it will cause a screen reader to read out everything in the dropdown, which disrupts the navigaition workflow

@martin-g
Copy link
Member

   ../../wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js
[INFO]     472 |                var input = Wicket.$(ajaxAttributes.c);
[INFO]                              ^ 'input' is already defined.
[INFO]     626 |            element.firstChild.role = "listbox"
[INFO]                                                         ^ Missing semicolon.
[INFO]     677 |                    node.setAttribute("aria-posinset", i + 1)
[INFO]                                                                       ^ Missing semicolon.
[INFO]     678 |                    node.setAttribute("aria-setsize", elementCount)
[INFO]                                                                             ^ Missing semicolon.

@strido
Copy link
Contributor Author

strido commented Nov 19, 2024

The code style issues should be fixed now

@martin-g martin-g merged commit b25c831 into apache:wicket-9.x Nov 19, 2024
1 check passed
martin-g pushed a commit that referenced this pull request Nov 19, 2024
* Improved accessability and screen reader support

* Ensure that the input field exists before trying to change its attributes

* Fix code style issues

---------

Co-authored-by: Erik Strid <[email protected]>
(cherry picked from commit b25c831)
bitstorm pushed a commit that referenced this pull request Dec 2, 2024
* Improved accessability and screen reader support

* Ensure that the input field exists before trying to change its attributes

* Fix code style issues

---------

Co-authored-by: Erik Strid <[email protected]>
(cherry picked from commit b25c831)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants