diff --git a/core/modules/field_ui/src/Form/EntityDisplayFormBase.php b/core/modules/field_ui/src/Form/EntityDisplayFormBase.php index 42a4e81..480161b 100644 --- a/core/modules/field_ui/src/Form/EntityDisplayFormBase.php +++ b/core/modules/field_ui/src/Form/EntityDisplayFormBase.php @@ -339,6 +339,10 @@ protected function buildFieldRow(FieldDefinitionInterface $field_definition, arr 'settings_edit_form' => [], ]; + if (empty($display_options['region'])) { + $field_row['plugin']['type']['#attributes']['class'][] = 'visually-hidden'; + } + // Get the corresponding plugin object. $plugin = $this->entity->getRenderer($field_name); diff --git a/core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php b/core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php index c27f3d4..861c744 100644 --- a/core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php +++ b/core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php @@ -49,6 +49,10 @@ protected function buildFieldRow(FieldDefinitionInterface $field_definition, arr ], ]; + if (empty($display_options['region'])) { + $label['label']['#attributes']['class'] = ['visually-hidden']; + } + $label_position = array_search('plugin', array_keys($field_row)); $field_row = array_slice($field_row, 0, $label_position, TRUE) + $label + array_slice($field_row, $label_position, count($field_row) - 1, TRUE);