File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,9 @@ class DocSearch {
80
80
this . autocompleteOptions . cssClasses || { } ;
81
81
this . autocompleteOptions . cssClasses . prefix =
82
82
this . autocompleteOptions . cssClasses . prefix || 'ds' ;
83
-
83
+ const inputAriaLabel = this . input && typeof this . input . attr === 'function' && this . input . attr ( 'aria-label' ) ;
84
+ this . autocompleteOptions . ariaLabel =
85
+ this . autocompleteOptions . ariaLabel || inputAriaLabel || "search input" ;
84
86
85
87
this . isSimpleLayout = layout === 'simple' ;
86
88
Original file line number Diff line number Diff line change @@ -175,6 +175,7 @@ describe('DocSearch', () => {
175
175
debug : false ,
176
176
cssClasses : { prefix : 'ds' } ,
177
177
anOption : 44 ,
178
+ ariaLabel : 'search input' ,
178
179
} ) ;
179
180
} ) ;
180
181
it ( 'should instantiate algoliasearch with the correct values' , ( ) => {
@@ -217,6 +218,7 @@ describe('DocSearch', () => {
217
218
anOption : '44' ,
218
219
cssClasses : { prefix : 'ds' } ,
219
220
debug : false ,
221
+ ariaLabel : 'search input'
220
222
} )
221
223
) . toBe ( true ) ;
222
224
} ) ;
You can’t perform that action at this time.
0 commit comments