[off-canvas] Inline checkboxes in off-canvas forms are displayed as block, causing line break

Created on 17 November 2022, almost 2 years ago
Updated 3 July 2024, 4 months ago

Problem/Motivation

Inline checkboxes in off-canvas forms are displayed as a block, causing a line break.

Steps to reproduce

1. Open "Layout" tab on some entity.
2. Click "Configure" on some block.
3. See the "Display title" checkbox, it looks bad:

4. Change the Drupal theme to the default one (eg Olivero) and repeat the steps, you'll see the correct placement of the checkbox:

Proposed resolution

Write a css rule to render checkboxes as inline-block element.
An example from Olivero theme (core/themes/olivero/css/components/form-boolean.css):

input[type="checkbox"],
input[type="radio"] {
  display: inline-block;
...
}

And seems the same problem will be in any other checkboxes with label, located in off-canvas area.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Closed: outdated

Version

3.0

Component

Code

Created by

🇦🇲Armenia murz Yerevan, Armenia

Live updates comments and jobs are added and updated live.
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.

  • 🇦🇲Armenia murz Yerevan, Armenia

    I've found the root cause of this issue - in the template web/themes/contrib/gin/templates/form/input--checkbox--toggle.html.twig gin adds the <span class="checkbox-toggle"> that breaks CSS rules for checkbox labels from the base theme.
    I've reworked the fix to a more optimal way of fixing this. Please review.

    Attaching a static patch file with those changes, to make it possible to use in composer until 🐛 GitLab Merge Requests Unable to Generate Incremental Patch Files Active is resolved.

  • Status changed to Closed: outdated 4 months ago
  • 🇨🇭Switzerland saschaeggi Zurich

    Closing as outdated, as we have removed that template a while ago.

Production build 0.71.5 2024