summaryrefslogtreecommitdiffstats
path: root/core/lib/Drupal/Core/Render
diff options
context:
space:
mode:
authorNathaniel Catchpole2017-09-26 12:13:58 (GMT)
committerNathaniel Catchpole2017-09-26 12:13:58 (GMT)
commit57762d192d623955d58fb8b17769d98a04d1309e (patch)
treebfa8af7899aeb1b668d9ca00b11461124ff2755c /core/lib/Drupal/Core/Render
parente64d7536a67594e35c5d89ef342da41996061b83 (diff)
Issue #2783615 by k4v, Dom., dawehner: Datetime FAPI element type do not allow AJAX via #ajax API
Diffstat (limited to 'core/lib/Drupal/Core/Render')
-rw-r--r--core/lib/Drupal/Core/Render/Element/Date.php5
-rw-r--r--core/lib/Drupal/Core/Render/Element/RenderElement.php2
2 files changed, 6 insertions, 1 deletions
diff --git a/core/lib/Drupal/Core/Render/Element/Date.php b/core/lib/Drupal/Core/Render/Element/Date.php
index 11e15d8..735b1d5 100644
--- a/core/lib/Drupal/Core/Render/Element/Date.php
+++ b/core/lib/Drupal/Core/Render/Element/Date.php
@@ -33,7 +33,10 @@ class Date extends FormElement {
return [
'#input' => TRUE,
'#theme' => 'input__date',
- '#process' => [[$class, 'processDate']],
+ '#process' => [
+ [$class, 'processAjaxForm'],
+ [$class, 'processDate'],
+ ],
'#pre_render' => [[$class, 'preRenderDate']],
'#theme_wrappers' => ['form_element'],
'#attributes' => ['type' => 'date'],
diff --git a/core/lib/Drupal/Core/Render/Element/RenderElement.php b/core/lib/Drupal/Core/Render/Element/RenderElement.php
index 243a9af..46c6f29 100644
--- a/core/lib/Drupal/Core/Render/Element/RenderElement.php
+++ b/core/lib/Drupal/Core/Render/Element/RenderElement.php
@@ -269,6 +269,7 @@ abstract class RenderElement extends PluginBase implements ElementInterface {
$element['#attributes']['data-disable-refocus'] = "true";
}
+
// Add a reasonable default event handler if none was specified.
if (isset($element['#ajax']) && !isset($element['#ajax']['event'])) {
switch ($element['#type']) {
@@ -308,6 +309,7 @@ abstract class RenderElement extends PluginBase implements ElementInterface {
case 'radio':
case 'checkbox':
case 'select':
+ case 'date':
$element['#ajax']['event'] = 'change';
break;