File tree Expand file tree Collapse file tree 5 files changed +32
-20
lines changed
tests/integration/components/power-select Expand file tree Collapse file tree 5 files changed +32
-20
lines changed Original file line number Diff line number Diff line change 3535 <li >
3636 <input
3737 type =" search"
38- role =" combobox"
3938 class =" ember-power-select-trigger-multiple-input"
4039 aria-activedescendant ={{ if @select.isOpen @ariaActiveDescendant }}
4140 aria-haspopup =" listbox"
4544 autocapitalize =" off"
4645 spellcheck ={{ false }}
4746 id =" ember-power-select-trigger-multiple-input-{{ @select.uniqueId }} "
47+ aria-labelledby ={{ @ariaLabelledBy }}
48+ aria-label ={{ @ariaLabel }}
4849 value ={{ @select.searchText }}
49- aria-controls ={{ @listboxId }}
50+ aria-controls ={{ if @ select.isOpen @listboxId }}
5051 style ={{ this.triggerMultipleInputStyle }}
5152 placeholder ={{ this.maybePlaceholder }}
5253 disabled ={{ @select.disabled }}
Original file line number Diff line number Diff line change 8181 (component ' power-select/placeholder' )
8282 }}
8383 @ariaActiveDescendant ={{ concat publicAPI.uniqueId " -" this.highlightedIndex }}
84+ @ariaLabelledBy ={{ @ariaLabelledBy }}
85+ @ariaLabel ={{ @ariaLabel }}
8486 as |opt term|>
8587 {{ yield opt term }}
8688 </Trigger >
109111 @ariaActiveDescendant ={{ concat publicAPI.uniqueId " -" this.highlightedIndex }}
110112 @selectedItemComponent ={{ ensure-safe-component @selectedItemComponent }}
111113 @searchPlaceholder ={{ @searchPlaceholder }}
114+ @ariaLabel ={{ @ariaLabel }}
115+ @ariaLabelledBy ={{ @ariaLabelledBy }}
112116 />
113117 {{ /let }}
114118 {{ /if }}
120124 (component ' power-select/search-message' )
121125 )
122126 as |SearchMessage |}}
123- <SearchMessage @searchMessage ={{ this.searchMessage }} @select ={{ publicAPI }} />
127+ <SearchMessage
128+ @searchMessage ={{ this.searchMessage }}
129+ @select ={{ publicAPI }}
130+ id ={{ listboxId }}
131+ aria-label ={{ @ariaLabel }}
132+ aria-labelledby ={{ @ariaLabelledBy }}
133+ />
124134 {{ /let }}
125135 {{ else if this.mustShowNoMessages}}
126136 {{ #let
130140 (component ' power-select/no-matches-message' )
131141 )
132142 as |NoMatchesMessage |}}
133- <NoMatchesMessage @noMatchesMessage ={{ this.noMatchesMessage }} @select ={{ publicAPI }} />
143+ <NoMatchesMessage
144+ @noMatchesMessage ={{ this.noMatchesMessage }}
145+ @select ={{ publicAPI }}
146+ id ={{ listboxId }}
147+ aria-label ={{ @ariaLabel }}
148+ aria-labelledby ={{ @ariaLabelledBy }}
149+ />
134150 {{ /let }}
135151 {{ else }}
136152 {{ #let
Original file line number Diff line number Diff line change 11{{ #if @searchEnabled }}
22 <div class =" ember-power-select-search" >
3- <input type =" search" autocomplete =" off"
4- autocorrect =" off" autocapitalize =" off"
5- spellcheck ={{ false }} role =" combobox"
3+ <input type =" search"
4+ autocomplete =" off"
5+ autocorrect =" off"
6+ autocapitalize =" off"
7+ spellcheck ={{ false }}
68 class =" ember-power-select-search-input"
79 value ={{ @select.searchText }}
810 aria-activedescendant ={{ @ariaActiveDescendant }}
911 aria-controls ={{ @listboxId }}
1012 aria-haspopup =" listbox"
1113 placeholder ={{ @searchPlaceholder }}
14+ aria-label ={{ @ariaLabel }}
15+ aria-labelledby ={{ @ariaLabelledBy }}
1216 {{ on " input" @onInput }}
1317 {{ on " focus" @onFocus }}
1418 {{ on " blur" @onBlur }}
Original file line number Diff line number Diff line change 1- <ul class =" ember-power-select-options" role =" listbox" >
1+ <ul class =" ember-power-select-options" role =" listbox" ...attributes >
22 <li class =" ember-power-select-option ember-power-select-option--search-message" role =" option" >
33 {{ @searchMessage }}
44 </li >
Original file line number Diff line number Diff line change @@ -652,7 +652,7 @@ module(
652652 } ) ;
653653
654654 test ( 'Dropdown with search enabled has proper aria attributes to associate search box with the options' , async function ( assert ) {
655- assert . expect ( 5 ) ;
655+ assert . expect ( 4 ) ;
656656 this . numbers = numbers ;
657657
658658 await render ( hbs `
@@ -676,9 +676,7 @@ module(
676676 'aria-controls' ,
677677 document . querySelector ( '.ember-power-select-dropdown' ) . id
678678 ) ;
679- assert
680- . dom ( '.ember-power-select-search-input' )
681- . hasAttribute ( 'role' , 'combobox' ) ;
679+
682680 assert
683681 . dom ( '.ember-power-select-search-input' )
684682 . hasAttribute ( 'aria-haspopup' , 'listbox' ) ;
@@ -815,7 +813,7 @@ module(
815813 } ) ;
816814
817815 test ( 'PowerSelectMultiple with search enabled has proper aria attributes' , async function ( assert ) {
818- assert . expect ( 11 ) ;
816+ assert . expect ( 10 ) ;
819817 this . numbers = numbers ;
820818
821819 await render ( hbs `
@@ -852,13 +850,6 @@ module(
852850
853851 await clickTrigger ( ) ;
854852
855- assert
856- . dom ( '.ember-power-select-trigger-multiple-input' )
857- . hasAttribute (
858- 'role' ,
859- 'combobox' ,
860- 'Multi select search box has role combobox'
861- ) ;
862853 assert
863854 . dom ( '.ember-power-select-trigger-multiple-input' )
864855 . hasAttribute (
You can’t perform that action at this time.
0 commit comments