Improve support for previewMode in Repeaters & NestedForms

Fixes #4521
This commit is contained in:
Luke Towers 2019-08-10 09:28:01 -06:00
parent c8ae520a79
commit b75d0af966
2 changed files with 6 additions and 0 deletions

View File

@ -42,6 +42,10 @@ class NestedForm extends FormWidgetBase
'usePanelStyles',
]);
if ($this->formField->disabled) {
$this->previewMode = true;
}
$config = $this->makeConfig($this->form);
$config->model = $this->model;
$config->data = $this->getLoadValue();
@ -54,6 +58,7 @@ class NestedForm extends FormWidgetBase
}
$widget = $this->makeWidget(Form::class, $config);
$widget->previewMode = $this->previewMode;
$widget->bindToController();
$this->formWidget = $widget;

View File

@ -277,6 +277,7 @@ class Repeater extends FormWidgetBase
}
$widget = $this->makeWidget('Backend\Widgets\Form', $config);
$widget->previewMode = $this->previewMode;
$widget->bindToController();
$this->indexMeta[$index] = [