Widget wrapper classes not applying to formatted text.

Created on 9 August 2023, 11 months ago
Updated 21 September 2023, 9 months ago

Problem/Motivation

It seems that

$element[$name]['#wrapper_attributes']['class'][] = 'customfield-inline__item';
if ($this->getSetting('customize') && isset($proportions[$name])) {
  $element[$name]['#wrapper_attributes']['class'][] = 'customfield-inline__item--' . $proportions[$name];
}

may not be applying correctly to text format widgets.

This seems to be happening because text format widgets render their own wrapper: text-format-wrapper.html.twig. This causes (pseudo-)markup to be produced like this:

<div class="customfield-inline">
  <div class="customfield-inline__item customfield-inline__item--one> <!-- Woo!  This works!
    <select ...>
  </div>
  <div> <!-- Bah! This is rendered by the `text-format-wrapper.html.twig` template!
    <div class="customfield-inline__item customfield-inline__item--two"> <!-- Making this no longer a child of the flex container! -->
      <wysiwyg>
    </div>
  </div>
</div>

Admittedly, I'm not the best at front-end stuff, so I'm not sure exactly how to fix this one.

Steps to reproduce

Configure a custom field with a select element and a WYSIWYG (in my case, I'm using a ckeditor4 text format still).

Proposed resolution

TBD

Remaining tasks

TBD

User interface changes

None

API changes

None

Data model changes

None

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Luke.Leber Pennsylvania

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024