@@ -82,10 +82,11 @@ const _defaults: AutocompleteOptions = {
82
82
onSearch : ( text : string , autocomplete : Autocomplete ) => {
83
83
const normSearch = text . toLocaleLowerCase ( ) ;
84
84
autocomplete . setMenuItems (
85
- autocomplete . options . data . filter (
86
- ( option ) =>
87
- option . id . toString ( ) . toLocaleLowerCase ( ) . includes ( normSearch ) ||
88
- option . text ?. toLocaleLowerCase ( ) . includes ( normSearch )
85
+
86
+ autocomplete . options . data . filter ( ( option ) =>
87
+ option . id . toString ( ) . toLocaleLowerCase ( ) . includes ( normSearch )
88
+ || option . text ?. toLocaleLowerCase ( ) . includes ( normSearch )
89
+
89
90
)
90
91
) ;
91
92
} ,
@@ -207,6 +208,7 @@ export class Autocomplete extends Component<AutocompleteOptions> {
207
208
this . container . style . maxHeight = this . options . maxDropDownHeight ;
208
209
this . container . id = `autocomplete-options-${ Utils . guid ( ) } ` ;
209
210
this . container . classList . add ( 'autocomplete-content' , 'dropdown-content' ) ;
211
+ this . container . ariaExpanded = 'true' ;
210
212
this . el . setAttribute ( 'data-target' , this . container . id ) ;
211
213
212
214
this . menuItems . forEach ( ( menuItem ) => {
@@ -253,6 +255,7 @@ export class Autocomplete extends Component<AutocompleteOptions> {
253
255
}
254
256
255
257
_removeDropdown ( ) {
258
+ this . container . ariaExpanded = 'false' ;
256
259
this . container . parentNode . removeChild ( this . container ) ;
257
260
}
258
261
@@ -377,6 +380,7 @@ export class Autocomplete extends Component<AutocompleteOptions> {
377
380
'style' ,
378
381
'display:grid; grid-auto-flow: column; user-select: none; align-items: center;'
379
382
) ;
383
+ item . tabIndex = 0 ;
380
384
// Checkbox
381
385
if ( this . options . isMultiSelect ) {
382
386
item . innerHTML = `
0 commit comments