Problem/Motivation
When a dependent field is placed inside a field group, changing the parent field replaces the dependent field's wrapper into an empty string, so the field disappears from the form.
ViewsSelection::updateDependentField() renders the element manually with $renderer->render($form_field). Elements that belong to a group carry #group, and RenderElementBase::preRenderGroup() defers their rendering to the group container — a direct render returns an empty string. Core handles this in ajax callbacks by unsetting #group before rendering, see \Drupal\Core\Form\FormAjaxResponseBuilder::buildResponse().
Proposed resolution
Unset #group on the element before rendering it for the ReplaceCommand, mirroring core's FormAjaxResponseBuilder.
Issue fork dependent_fields-3609028
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
pcambraComment #5
pcambra