Skip to content

Commit

Permalink
Fixes behaviour of UpArrow on combobox to match ARIA spec
Browse files Browse the repository at this point in the history
  • Loading branch information
klovaaxel committed Feb 11, 2024
1 parent 5af4015 commit f7cfc8d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ export function handleComboBoxKeyPress(this: ComboboxFramework, event: KeyboardE
break;
case "UpArrow":
// (Optional): If the popup is available, places focus on the last focusable element in the popup.
if (this._input!.getAttribute("aria-expanded") !== "true") {
this.toggleList(true);
if (this._input!.getAttribute("aria-expanded") === "true") {
this.focusItem(
this._list!.children[this._list!.children.length - 1] as HTMLElement,
);
Expand Down

0 comments on commit f7cfc8d

Please sign in to comment.