Skip to content

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