Update SearchForm.php

Added aria label for Search textbox
This commit is contained in:
Kyle Huynh 2023-02-09 17:05:06 -05:00 committed by GitHub
parent e632b96314
commit 134e8aa4aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -44,7 +44,11 @@ class SearchForm extends FormBase
$form['search-textfield'] = array( $form['search-textfield'] = array(
'#type' => 'textfield', '#type' => 'textfield',
'#title' => (!empty($settings['search_textfield_label']) ? $settings['search_textfield_label'] : ''), '#title' => (!empty($settings['search_textfield_label']) ? $settings['search_textfield_label'] : ''),
'#attributes' => ['placeholder' => $settings['search_placeholder']] '#attributes' => [
'placeholder' => $this->t($settings['search_placeholder']),
'aria-label' => $this->t($settings['search_placeholder']),
],
'#theme_wrappers' => []
); );
$form['actions']['#type'] = 'actions'; $form['actions']['#type'] = 'actions';