Problem/Motivation

For a date form element, the theme adds an empty line between the form element and its description, which is shown after the form element. It seems like the description is for the next form element, which is confusing.

screenshot

This does not happen with the Claro theme, the admin theme used by default in Drupal 11.

screenshot

Steps to reproduce

  • Create a date field on an entity, with a description
  • Edit the entity
  • See how the date fields are rendered

Proposed resolution

The spacing comes from container-inline in datetime-form.html.twig. The theme should probably not use that class.

Issue fork seven-3573981

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

adamps created an issue. See original summary.

adamps’s picture

Title: Date field input spacing comes between input and description » Date field form spacing comes between input and description
avpaderno’s picture

Title: Date field form spacing comes between input and description » An empty line is added between a date form element and its description
Issue summary: View changes
avpaderno’s picture

Issue summary: View changes

avpaderno’s picture

Status: Active » Needs review
avpaderno’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new13.26 KB

The existing gap has been reduced. It should be clear for which field the description is.

screenshot

  • avpaderno committed 9d63cfc9 on 2.0.x
    Issue #3573981: An empty line is added between a date form element and...
avpaderno’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • avpaderno committed 4e2fa1e8 on main
    Issue #3573981: An empty line is added between a date form element and...

Status: Fixed » Closed (fixed)

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

macdev_drupal’s picture

StatusFileSize
new20.53 KB

This change now breaks the layout of the publication date module I guess:
overlapping help text at date fields