Problem/Motivation

We have a case where we want to hide the legend of a form field. If we add $form['field']['#title_display'] = 'invisible'; in code, this doesn't hide the required span. Maybe we would then need a helper class that hides the legend completely?

Proposed resolution

Add a fieldset__hidden-legend class or similar to forms.scss.

Comments

sasanikolic created an issue. See original summary.

pivica’s picture

Status: Active » Needs review
Issue tags: +next-release
StatusFileSize
new854 bytes

I think it is much easier to just not render required mark span element in a case when title_display is invisible. Attaching a patch for this, tested against webform fieldset, works OK.

  • pivica committed fca998d on 8.x-1.x
    Issue #3073559 by pivica, sasanikolic: Add a helper class to hide...
pivica’s picture

Status: Needs review » Fixed
Issue tags: -next-release

Committed.

Status: Fixed » Closed (fixed)

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

forbidden_’s picture

If I just need to hide Cateogey legend fieldset from all webforms how?

pivica’s picture

> If I just need to hide Cateogey legend fieldset from all webforms how?

Really depends a lot on your html. But I would do this probably with custom CSS in custom theme.