Default Classes Are Removed when Custom Classes are used

Created on 15 September 2022, over 2 years ago
Updated 21 September 2023, over 1 year ago

Problem/Motivation

When a fieldset is not using any HTML classes, it defaults the class to the name of the fieldset.

For example, if a fieldset (assuming div) is called "Row One", the class will look like

<div class="row-one views-fieldset" data-module="views_fieldsets">

However, if a custom class is used on the fieldset, the fieldsets "name" class is removed.

Example using the custom class "row-color"

<div class="row-color views-fieldset" data-module="views_fieldsets">

Steps to reproduce

1) Install Views Fieldset and setup accordingly
2) Test between a blank "HTML class" and a custom "HTML class" within a fieldset field.

Proposed resolution

There should be consistency. If the class is present when no custom class is used, then it should be present if a custom class is used. Otherwise, there should be NO default class and it is explicitly expected a custom class will be used.

I just ran into this issue by styling for the default name class. As soon as I added some custom classes, I had to re-populate the default class in with the custom classes.

Remaining tasks

Test, confirm, fix

Thoughts

If fixed, this may end up causing duplicate classes for some situations. It shouldn't be a problem, however it might be something worth mentioning in patch notes if this is ever fixed and committed.

πŸ› Bug report
Status

Closed: outdated

Version

2.3

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States philsward

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.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Helping co-maintain this module for D10 going forward. Don't plan on doing any work with D7 unless something comes up for review.

    Since D7 version of this module hasn't had a release in 5+ think it's safe to close out so that focus can stay on D10+

Production build 0.71.5 2024