Grid won't allow sub-grids

Created on 7 June 2024, 6 months ago

Problem/Motivation

I'm trying to use the grid feature, which is really nice and convenient. The issue is that there are times where I need to put certain USWDS elements inside a grid column and it unwraps them upon saving the page and editing it again. The elements are placed outside the column, but are left inside the grid row and the parent-most element (usually a Div) has been removed while all child elements of the parent element are still there. In the example below, the usa-card element is removed while the usa-card__header and usa-card__body remain

Also note, the only 2 Content Editor filters that we have turned on are Display embedded paragraphs and Display embedded entities, no other HTML correction or anything is enabled.

Steps to reproduce

Step 1, use the USWDS Grid button to insert a 2 (or any #) column grid.

Step 2: Insert a USWDS element, like a card. Note that the card doesn't need to be the first element within a column for the unwrapping to occur. It's now time to save the page, you'll notice that the page looks correct, no change to the code has taken place.

Step 3: Edit the page and now you'll notice that the WYSYWIG editor looks drastically different, switch to code view and you'll see that the card element's top div was removed, the remaining elements have been moved out of their column and into the grid-row container

Proposed resolution

I'm not sure why this is happening. One thing I have found is that if I remove the top ck-widget element and remove the data elements and ck-widget class from the grid-row - it stops breaking things, however, I lose the nice WYSYWIG ability to modify the grid.

I'm not sure what suggestions to make, hopefully this is enough information to identify the issue and find a path to resolving it.

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States rex.barkdoll

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

Comments & Activities

Production build 0.71.5 2024