Skip to content
Snippets Groups Projects
Commit f14ad2f1 authored by wodby's avatar wodby Committed by Kevin Paxman
Browse files

ISTWCMS-4729: adding input and select labels and submit value in search in...

ISTWCMS-4729: adding input and select labels and submit value in search in order to pass wave accrssibility
parent 4a89f916
No related branches found
No related tags found
1 merge request!239ISTWCMS 4729 ebremner search form
...@@ -33,7 +33,7 @@ class UwSearchForm extends FormBase { ...@@ -33,7 +33,7 @@ class UwSearchForm extends FormBase {
// Element used to open the tray for phone view. // Element used to open the tray for phone view.
$form['opentray'] = [ $form['opentray'] = [
'#type' => 'checkbox', '#type' => 'checkbox',
'#title' => $this->t('<span class="uw-search--checkboxlabel--labeltext"></span>'), '#title' => $this->t('<span class="uw-search--checkboxlabel--labeltext">Search Checkbox</span>'),
'#label_classes' => [ '#label_classes' => [
'uw-search--checkboxlabel', 'uw-search--checkboxlabel',
], ],
...@@ -42,6 +42,7 @@ class UwSearchForm extends FormBase { ...@@ -42,6 +42,7 @@ class UwSearchForm extends FormBase {
'uw-input', 'uw-input',
'uw-input--checkboxform', 'uw-input--checkboxform',
], ],
'aria-hidden' => 'true',
], ],
'#theme_wrappers' => [], '#theme_wrappers' => [],
]; ];
...@@ -53,12 +54,13 @@ class UwSearchForm extends FormBase { ...@@ -53,12 +54,13 @@ class UwSearchForm extends FormBase {
// label. // label.
$form['label'] = [ $form['label'] = [
'#theme' => 'form_element_label', '#theme' => 'form_element_label',
'#title' => $this->t('<span class="uw-search--checkboxlabel--labeltext"></span>'), '#title' => $this->t('<span class="uw-search--checkboxlabel__labeltext">Open Search </span>'),
'#title_display' => 'after', '#title_display' => 'after',
'#required' => FALSE, '#required' => FALSE,
'#id' => 'edit-opentray', '#id' => 'edit-opentray',
'#attributes' => [ '#attributes' => [
'class' => ['uw-search--checkboxlabel'], 'class' => ['uw-search--checkboxlabel'],
'aria-hidden' => 'true',
], ],
]; ];
...@@ -70,8 +72,18 @@ class UwSearchForm extends FormBase { ...@@ -70,8 +72,18 @@ class UwSearchForm extends FormBase {
], ],
'#id' => 'uw-search', '#id' => 'uw-search',
'#placeholder' => $this->t('Search'), '#placeholder' => $this->t('Search'),
'#title' => $this->t('<span class="uw-search--labeltext">Search Text </span>'),
'#title_display' => 'invisible',
'#label' => [
'#theme' => 'form_element_label',
'#required' => FALSE,
'#id' => 'uw-search',
'#attributes' => [
'class' => ['uw-search--hidelabel'],
'aria-hidden' => 'true',
],
],
]; ];
// Get the URL for this site to be used in the options. // Get the URL for this site to be used in the options.
$url = Url::fromRoute('<front>', [], ['absolute' => TRUE])->toString(); $url = Url::fromRoute('<front>', [], ['absolute' => TRUE])->toString();
...@@ -86,6 +98,17 @@ class UwSearchForm extends FormBase { ...@@ -86,6 +98,17 @@ class UwSearchForm extends FormBase {
'' => $this->t('On all sites'), '' => $this->t('On all sites'),
'inurl:' . $url => $this->t('On this site'), 'inurl:' . $url => $this->t('On this site'),
], ],
'#title_display' => 'invisible',
'#title' => $this->t('Select Label'),
'#label' => [
'#theme' => 'form_element_label',
'#required' => FALSE,
'#id' => 'uw-select-site',
'#attributes' => [
'class' => ['uw-search--hidelabel'],
'aria-hidden' => 'true',
],
],
]; ];
// The submit button. // The submit button.
...@@ -93,6 +116,7 @@ class UwSearchForm extends FormBase { ...@@ -93,6 +116,7 @@ class UwSearchForm extends FormBase {
$form['actions']['submit'] = [ $form['actions']['submit'] = [
'#type' => 'submit', '#type' => 'submit',
'#attributes' => [ '#attributes' => [
'value' => $this->t('Search'),
'class' => [ 'class' => [
'button', 'button',
'button--submit', 'button--submit',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment