Skip to content

Commit

Permalink
Add id, aria-label & aria-labelledby to all listboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed Nov 10, 2020
1 parent c59a136 commit 24f9f40
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 14 additions & 2 deletions addon/components/power-select.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,23 @@
{{/let}}
{{#if this.mustShowSearchMessage}}
{{#let (component (or @searchMessageComponent "power-select/search-message")) as |SearchMessage|}}
<SearchMessage @searchMessage={{this.searchMessage}} @select={{publicAPI}}/>
<SearchMessage
@searchMessage={{this.searchMessage}}
@select={{publicAPI}}
id={{listboxId}}
aria-label={{@ariaLabel}}
aria-labelledby={{@ariaLabelledBy}}
/>
{{/let}}
{{else if this.mustShowNoMessages}}
{{#if this.noMatchesMessage}}
<ul class="ember-power-select-options" role="listbox">
<ul
class="ember-power-select-options"
role="listbox"
id={{listboxId}}
aria-label={{@ariaLabel}}
aria-labelledby={{@ariaLabelledBy}}
>
<li class="ember-power-select-option ember-power-select-option--no-matches-message" role="option">
{{this.noMatchesMessage}}
</li>
Expand Down
2 changes: 1 addition & 1 deletion addon/components/power-select/search-message.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ul class="ember-power-select-options" role="listbox">
<ul class="ember-power-select-options" role="listbox" ...attributes>
<li class="ember-power-select-option ember-power-select-option--search-message" role="option">
{{@searchMessage}}
</li>
Expand Down

0 comments on commit 24f9f40

Please sign in to comment.