Blocks with fixed width elements can break multi-column Layout Builder layouts

Created on 28 January 2019, almost 6 years ago
Updated 31 October 2023, about 1 year ago

Problem/Motivation

This problem occurs if content is added to a Layout builder and that content includes an element styled with a fixed width wider than the width of the column.
The column will assume the width of the wider child element, breaking the column layout.

This was discovered (and easy to reproduce) with the comment block, but this issue will happen with any content styled wider than the column width.

How this was discovered:

Steps to reproduce (also see youtube recording )

- Vanilla Drupal 8 (I used simplytest.me to verify)
- Activate Layout Builder module
- Activate Layout Builder on Article
- Modify Layout with two columns with body left and comments to the right
- Enter a artice (the comment form shows underneath instead beside)
- Enter comments
- Save

The comments appear below the body instead of to the right

Proposed resolution

Most likely resolution: Add Javascript that detects if a column includes a fixed width element that would cause the column to break to another line. In these cases, the columns should still break to another line, but their width should also be set to 100% (essentially the same behavior as what would take place at narrower screen widths, as the layouts are responsive)

Possible alternative: Add Y-scrolling to columns that would otherwise break to another line. This couuld

Approach that was discussed that will most likely not be used: setting the columns to overflow: hidden would also address the symptoms, but was considered a nonviable solution as it could potentially limit access to important content or inputs.

Remaining tasks

Get feedback on solution, ideally from real-world users.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Layout builder 

Last updated 4 days ago

Created by

🇳🇱Netherlands parijke

Live updates comments and jobs are added and updated live.
  • Blocks-Layouts

    Blocks and Layouts Initiative. See the #2811175 Add layouts to Drupal issue.

  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

  • Needs documentation

    A documentation change is requested elsewhere. For Drupal core (and possibly other projects), once the change has been committed, this status should be recorded in a change record node.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024