From d6c762af38c1e321feb09c9c79502fcd56e54aac Mon Sep 17 00:00:00 2001 From: apple-bears Date: Tue, 24 Feb 2026 10:04:20 -0600 Subject: [PATCH] Iterate over the fields to disable nested form to get correct disabled UI. --- modules/backend/formwidgets/NestedForm.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/backend/formwidgets/NestedForm.php b/modules/backend/formwidgets/NestedForm.php index c4479f5fc4..509a718e7c 100644 --- a/modules/backend/formwidgets/NestedForm.php +++ b/modules/backend/formwidgets/NestedForm.php @@ -42,9 +42,6 @@ public function init() 'usePanelStyles', ]); - if ($this->formField->disabled) { - $this->previewMode = true; - } $config = $this->makeConfig($this->form); $config->model = $this->model; @@ -53,6 +50,12 @@ public function init() $config->arrayName = $this->getFieldName(); $config->isNested = true; + if ($this->formField->disabled) { + foreach ($config->fields as &$field) { + $field["disabled"] = true; + }; + } + if (object_get($this->getParentForm()->config, 'enableDefaults') === true) { $config->enableDefaults = true; }