Skip to content

Commit 61bcd91

Browse files
authored
Merge pull request #516 from gselderslaghs/dropdown-accessibility
fix(Dropdown): accessibility - implemented aria-expanded #229
2 parents bd1284d + 15cd897 commit 61bcd91

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/dropdown.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ export class Dropdown extends Component<DropdownOptions> implements Openable {
125125
this.isTouchMoving = false;
126126
this.focusedIndex = -1;
127127
this.filterQuery = [];
128+
this.el.ariaExpanded = 'false'
128129

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

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

633636
/**

0 commit comments

Comments
 (0)