This can be seen at http://dev.demo-olivero.local/form/example-accessibility-labels

Problem/Motivation

If we don't set a legend (#title) for a fieldset, there is no padding for this element

With a legend:
fieldset with a legend
Without a legend:
fieldset without legend

Steps to reproduce

Display a fieldset without legend

Proposed resolution

As the problem is coming from the .fieldset__legend--visible class which is only there when a legend exist, my proposal is to remove this class in the css rules to apply the padding for all fieldset.

In css/components/fieldset.pcss.css, change this

.fieldset__legend--visible ~ .fieldset__wrapper {
  margin-block-start: 0;
  padding-block: var(--sp);
  padding-inline-start: var(--sp);
  padding-inline-end: var(--sp);
}

into this:

.fieldset__wrapper {
  margin-block-start: 0;
  padding-block: var(--sp);
  padding-inline-start: var(--sp);
  padding-inline-end: var(--sp);
}

Let me know what you think

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DuneBL created an issue. See original summary.

Gauravvvv’s picture

I have provided the patch with the possible solution you suggested, please review.

Gauravvvv’s picture

Status: Active » Needs review
DuneBL’s picture

Many thanks, looks good to me
But I don't know why the the failed...

Gauravvvv’s picture

Removed a white empty line, let's hope if it works.

Gauravvvv’s picture

Please review if this is working or not.

DuneBL’s picture

Status: Needs review » Reviewed & tested by the community

Hello, I confirm that patch apply cleanly and is doing the job!!
Thank you.

ilgnerfagundes’s picture

FileSize
32.74 KB

I reviewed the modifications to patch #6, and it looks fine., rtbc +1

lauriii’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs review
FileSize
25.05 KB

Can we document steps for reproducing this? I tried to create fieldset with invisible legend but it looks different:

djsagar’s picture

For this issue to replicate i added fieldset in user login form.

You can also use fieldset module for this.

@Gauravmahlawat patch is applied resolved above issue.

RTBC +1 for patch

Thanks!

Abhijith S’s picture

FileSize
86.61 KB
72.88 KB

Applied patch #6 and it works fine.Adding screenshots below.

Before patch:
before

After path:
after

RTBC +1

mherchel’s picture

Issue summary: View changes
Issue tags: +Needs reroll

Needs re-roll

Confirmed this is still happening. You can view this on http://dev.demo-olivero.local/form/example-accessibility-labels

mherchel’s picture

Status: Needs review » Needs work

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

cindytwilliams’s picture

anish.a’s picture

Issue tags: -Needs reroll
mherchel’s picture

Title: Missing padding for fieldset without legend » Olivero: Missing padding for fieldset without legend
Priority: Normal » Minor

Confirmed this is still happening.

xjm’s picture

Priority: Minor » Normal

Normal priority bug under the normal issue priority definition:

Bugs for site visitors that do not interfere with site use, for example, visual layout issues.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

andy-blum’s picture

Status: Needs review » Needs work

Patch no longer applies.

_pratik_’s picture

Status: Needs work » Needs review
FileSize
1.32 KB
1.12 KB

Rerolled for 10.1.x
Patch applying cleanly for me.

andy-blum’s picture

Status: Needs review » Needs work

Per tests, patch does not apply.

ameymudras’s picture

Status: Needs work » Needs review
FileSize
1.12 KB

Trying to fix the issue with the above patch

andy-blum’s picture

Padding remains regardless of fieldset legend. RTBC.

andy-blum’s picture

Status: Needs review » Reviewed & tested by the community

  • lauriii committed 0498fbfc on 10.1.x
    Issue #3195828 by Gauravvv, _pratik_, cindytwilliams, ameymudras, andy-...
lauriii’s picture

Status: Reviewed & tested by the community » Fixed

Committed 0498fbf and pushed to 10.1.x. Thanks!

Status: Fixed » Closed (fixed)

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