Skip to content

Commit

Permalink
add placeholder and aria label for #356
Browse files Browse the repository at this point in the history
  • Loading branch information
elizoller committed Sep 29, 2021
1 parent 24ea987 commit 309e8b7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion web/modules/custom/asu_search/src/Form/SearchForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,22 @@ public function getFormId() {
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$config = \Drupal::config('system.site');
$form['#attributes']['class'][] = 'form--inline';
$form['search_api_fulltext'] = [
'#type' => 'textfield',
'#title' => $this->t('keyword'),
'#size' => 30,
'#weight' => '0',
'#title_display' => 'invisible',
'#attributes' => ['placeholder' => 'Search ' . $config->get('name') ],
];
$form['actions']['submit'] = [
'#type' => 'submit',
'#title' => $this->t('Search'),
'#weight' => '0',
'#value' => 'Search',
'#attributes' => ['class' => ['col-md-3', 'form--inline']],
'#attributes' => ['class' => ['col-md-3', 'form--inline'], 'aria-label' => 'Search ' + $config->get('name')],
];
return $form;
}
Expand Down

0 comments on commit 309e8b7

Please sign in to comment.