Skip to content

Commit efffa86

Browse files
authored
[5.3] Awesomplete accessibility fix (#44756)
Pass language string for listLabel option to awesomplete initalization --------- Co-authored-by: @JackKellyUK Co-authored-by: @dgrammatiko
1 parent c2f625b commit efffa86

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

build/media_source/com_finder/js/finder.es6.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
document.querySelectorAll('.js-finder-search-query').forEach((searchword) => {
7070
// Handle the auto suggestion
7171
if (Joomla.getOptions('finder-search')) {
72-
searchword.awesomplete = new Awesomplete(searchword);
72+
searchword.awesomplete = new Awesomplete(searchword, { listLabel: Joomla.Text._('COM_FINDER_SEARCH_FORM_LIST_LABEL') });
7373

7474
// If the current value is empty, set the previous value.
7575
searchword.addEventListener('input', onInputChange);

components/com_finder/tmpl/search/default_form.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
$this->getDocument()->getWebAssetManager()->usePreset('awesomplete');
2323
$this->getDocument()->addScriptOptions('finder-search', ['url' => Route::_('index.php?option=com_finder&task=suggestions.suggest&format=json&tmpl=component', false)]);
2424

25+
Text::script('COM_FINDER_SEARCH_FORM_LIST_LABEL');
2526
Text::script('JLIB_JS_AJAX_ERROR_OTHER');
2627
Text::script('JLIB_JS_AJAX_ERROR_PARSE');
2728
}

language/en-GB/com_finder.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ COM_FINDER_QUERY_TOKEN_OPTIONAL="<span class=\"term\">%s</span> is optional"
4545
COM_FINDER_QUERY_TOKEN_REQUIRED="<span class=\"term\">%s</span> is required"
4646
COM_FINDER_SEARCH_ADVANCED_LEGEND="Advanced Search"
4747
COM_FINDER_SEARCH_FORM_LEGEND="Search Form"
48+
COM_FINDER_SEARCH_FORM_LIST_LABEL="Search Results"
4849
COM_FINDER_SEARCH_NO_RESULTS_BODY="No search results could be found for query: %s."
4950
COM_FINDER_SEARCH_NO_RESULTS_BODY_MULTILANG="No search results in English (en-GB) could be found for query: %s."
5051
COM_FINDER_SEARCH_NO_RESULTS_HEADING="No Results Found"

modules/mod_finder/tmpl/default.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
$wa->usePreset('awesomplete');
5353
$app->getDocument()->addScriptOptions('finder-search', ['url' => Route::_('index.php?option=com_finder&task=suggestions.suggest&format=json&tmpl=component', false)]);
5454

55+
Text::script('COM_FINDER_SEARCH_FORM_LIST_LABEL');
5556
Text::script('JLIB_JS_AJAX_ERROR_OTHER');
5657
Text::script('JLIB_JS_AJAX_ERROR_PARSE');
5758
}

0 commit comments

Comments
 (0)