Problem/Motivation

A group of radio buttons has a confusingly large vertical margin in between them. They almost look like they don't belong to each other in the same group.
A group of checkboxes OTOH has a much smaller vertical margin.

Checkboxes have a smaller margin due a surrounding div.form-boolean-group, which is added in core/themes/claro/templates/form/checkboxes.html.twig.
Radio buttons have a similar markup in core/themes/claro/templates/form/radios.html.twig.

BUT: The correct template for radio buttons is overwritten by core/themes/claro/templates/classy/form/radios.html.twig, which does not have the .form-boolean-group class.

Steps to reproduce

Use the form widget "Checkboxes / Radio buttons" for any entity reference field with a cardinality of 1

Proposed resolution

Delete the incorrect, needlescore/themes/claro/templates/classy/form/radios.html.twig template.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hudri created an issue. See original summary.

hudri’s picture

Title: Incorrect radio button spacing due superfluent twig » Incorrect radio button spacing due needless twig template
lauriii’s picture

Status: Active » Needs review
FileSize
1.26 KB

Tested manually and I couldn't reproduce the problem. For some reason when I test this, the correct template is picked up. However, I can see how the extra template could cause problems if loaded, so here's a patch to remove it.

lauriii’s picture

Version: 8.9.x-dev » 9.1.x-dev
bandanasharma’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
280.24 KB
217.58 KB

#3 patch is apply successfully. Adding some manually testing images for more visualization.

  • catch committed d91112e on 9.1.x
    Issue #3164871 by lauriii, bandanasharma, hudri: Incorrect radio button...
catch’s picture

Title: Incorrect radio button spacing due needless twig template » [backport] Incorrect radio button spacing due needless twig template
Status: Reviewed & tested by the community » Fixed

Committed d91112e and pushed to 9.1.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.