Skip to content
Snippets Groups Projects
Commit cbe2b178 authored by Daniel Cothran's avatar Daniel Cothran
Browse files

Issue #3460698 by andileco, nikathone: Remove the color changer from the chart...

Issue #3460698 by andileco, nikathone: Remove the color changer from the chart field preview to avoid a form inside a form
parent 890e5129
No related branches found
No related tags found
1 merge request!99Update 2 files
Pipeline #221384 passed with warnings
......@@ -465,7 +465,7 @@ class Highcharts extends ChartBase implements ContainerFactoryPluginInterface {
$element['#attributes']['class'][] = 'charts-highchart';
$element['#chart_definition'] = $chart_definition;
// Show a form on the front-end so users can change chart colors.
if (!empty($element['#color_changer'])) {
if (!empty($element['#color_changer']) && empty($element['#in_preview_mode'])) {
$form_state = new FormState();
$form_state->set('chart_series', $series);
$form_state->set('chart_id', $element['#id']);
......
......@@ -1311,6 +1311,7 @@ class BaseSettings extends FormElement {
$chart_build['#id'] = $id_prefix . '--preview-chart';
// @todo check if this would work with various hooks.
$chart_build['#chart_id'] = $chart_id;
$chart_build['#in_preview_mode'] = TRUE;
$element['preview']['content'] = $chart_build;
}
else {
......
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