Skip to content

Commit

Permalink
Fixes issues of #17255. Fix tab sequence (#17256)
Browse files Browse the repository at this point in the history
* fixes issus #17252. a11y improvements. fix Talkback item selection. i18n for the status text.

* fixes issues of #17252. a11y improvements. fix Talkback item selection. i18n for the status text.

* Make aria-activedescendant empty when none is selected. see w3c/aria#501 (comment)

* Make aria-activedescendant empty when none is selected. see w3c/aria#501 (comment)

* Transformation must end with visibility hidden. Fixes tab navigation to hidden li item

* Also in css leading tab characters. After css transition everything in the suggestion list must be hidden and for example links in suggestions should not be in the tab sequence anymore

* Fixes issue of #17255. Tab navigation when suggestions are shown is wrong

---------

Co-authored-by: Nico <[email protected]@users.noreply.github.com>
  • Loading branch information
nico-amsterdam and Nico authored Jul 25, 2024
1 parent 0c58da5 commit 96cddba
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions awesomplete.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion awesomplete.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion awesomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ _.prototype = {
this.index = -1;

this.status.setAttribute("hidden", "");
this.input.setAttribute("aria-activedescendant", "");

$.fire(this.input, "awesomplete-close", o || {});
},
Expand Down Expand Up @@ -345,6 +346,8 @@ _.prototype = {
this.close({ reason: "nomatches" });

} else {
this.input.setAttribute("aria-activedescendant", ""); // none of the list items currently has aria-selected="true"

this.open();

this.status.textContent = this.statusXResults.replaceAll('{0}', this.ul.children.length); // N results found;
Expand Down Expand Up @@ -397,7 +400,7 @@ _.ITEM = function (text, input, item_id) {
innerHTML: html,
"role": "option",
"aria-selected": "false",
"tabindex": '0', // for the Talkback screen reader
"tabindex": "-1", // for the Talkback screen reader
"id": "awesomplete_list_" + this.count + "_item_" + item_id
});
};
Expand Down
Loading

0 comments on commit 96cddba

Please sign in to comment.