Skip to content

Commit

Permalink
Add aria-label & aria-labelled-by to single select search input
Browse files Browse the repository at this point in the history
Otherwise, the input has no label.
This also removes the role="combobox" from the input, as that is redundant for input type="search" and axe also complains about it.
  • Loading branch information
Francesco Novy authored and mydea committed May 18, 2020
1 parent 096acd1 commit fa3ed70
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions addon/templates/components/power-select.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@
@listboxId={{listboxId}}
@selectedItemComponent={{@selectedItemComponent}}
@searchPlaceholder={{@searchPlaceholder}}
@ariaLabel={{@ariaLabel}}
@ariaLabelledBy={{@ariaLabelledBy}}
/>
{{/let}}
{{#if this.mustShowSearchMessage}}
Expand Down
10 changes: 7 additions & 3 deletions addon/templates/components/power-select/before-options.hbs
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{{#if @searchEnabled}}
<div class="ember-power-select-search">
<input type="search" autocomplete="off"
autocorrect="off" autocapitalize="off"
spellcheck={{false}} role="combobox"
<input type="search"
autocomplete="off"
autocorrect="off"
autocapitalize="off"
spellcheck={{false}}
class="ember-power-select-search-input"
value={{@select.searchText}}
aria-controls={{@listboxId}}
placeholder={{@searchPlaceholder}}
aria-label={{@ariaLabel}}
aria-labelledby={{@ariaLabelledBy}}
{{on "input" @onInput}}
{{on "focus" @onFocus}}
{{on "blur" @onBlur}}
Expand Down

0 comments on commit fa3ed70

Please sign in to comment.