Skip to content

Commit

Permalink
fix(Dropdown): accessibility - implemented aria-expanded
Browse files Browse the repository at this point in the history
  • Loading branch information
gselderslaghs committed Oct 14, 2024
1 parent d74ac66 commit 15cd897
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export class Dropdown extends Component<DropdownOptions> implements Openable {
this.isTouchMoving = false;
this.focusedIndex = -1;
this.filterQuery = [];
this.el.ariaExpanded = 'false'

// Move dropdown-content after dropdown-trigger
this._moveDropdown();
Expand Down Expand Up @@ -610,6 +611,7 @@ export class Dropdown extends Component<DropdownOptions> implements Openable {
// Do this one frame later so that we don't bind an event handler that's immediately
// called when the event bubbles up to the document and closes the dropdown
setTimeout(() => this._setupTemporaryEventHandlers(), 0);
this.el.ariaExpanded = 'true'
}

/**
Expand All @@ -628,6 +630,7 @@ export class Dropdown extends Component<DropdownOptions> implements Openable {
if (this.options.autoFocus) {
this.el.focus();
}
this.el.ariaExpanded = 'false'
}

/**
Expand Down

0 comments on commit 15cd897

Please sign in to comment.