Commit d4d05dca authored by Neslee's avatar Neslee
Browse files

Issue #3158588 by jberube, Etroid: Autocomplete suggestions cover datepicker

parent c90fbfac
......@@ -52,11 +52,13 @@ class DatePickers extends FilterWidgetBase {
&& 'date_text' == $form[$field_id]['min']['#type']
&& 'date_text' == $form[$field_id]['max']['#type'];
// @todo lots of repetition of code. Let's re-organize and clean up.
if ($is_single_date || $is_double_date) {
if (isset($form[$field_id]['value'])) {
$format = $form[$field_id]['value']['#date_format'];
$form[$field_id]['value']['#attributes']['class'][] = 'bef-datepicker';
$form[$field_id]['value']['#attributes']['type'] = 'date';
$form[$field_id]['value']['#attributes']['autocomplete'] = 'off';
}
else {
// Both min and max share the same format.
......@@ -65,6 +67,8 @@ class DatePickers extends FilterWidgetBase {
$form[$field_id]['max']['#attributes']['class'][] = 'bef-datepicker';
$form[$field_id]['min']['#attributes']['type'] = 'date';
$form[$field_id]['max']['#attributes']['type'] = 'date';
$form[$field_id]['min']['#attributes']['autocomplete'] = 'off';
$form[$field_id]['max']['#attributes']['autocomplete'] = 'off';
}
// Convert Date API format to jQuery UI date format.
......@@ -84,12 +88,14 @@ class DatePickers extends FilterWidgetBase {
if (isset($form[$field_id][$field])) {
$form[$field_id][$field]['#attributes']['class'][] = 'bef-datepicker';
$form[$field_id][$field]['#attributes']['type'] = 'date';
$form[$field_id][$field]['#attributes']['autocomplete'] = 'off';
}
}
}
else {
$form[$field_id]['#attributes']['class'][] = 'bef-datepicker';
$form[$field_id]['#attributes']['type'] = 'date';
$form[$field_id]['#attributes']['autocomplete'] = 'off';
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment