Move "visually-hidden" class to form element wrapper rather than form element

Created on 26 February 2024, 10 months ago
Updated 15 June 2024, 7 months ago

Problem/Motivation

When a field is being edited on the "Manage form display" page, the form element within the field collection receives a `visually-hidden` class but the form element wrapper is still unchanged. This can cause display issues with custom select styling which rely on the form element wrapper as well as the form element within it.

Steps to reproduce

1. Configure a field within a field collection on the "Manage form display" page for any entity type
2. Verify the form element being edited has a class of "visually-hidden"

Proposed resolution

Move the "visually-hidden" class to the "#wrapper_attributes" rather than the "#attributes" so the class is being added to the form element wrapper rather than the form element.

field_ui.inc

-      $table[$name]['format']['type']['#attributes']['class'] = ['visually-hidden'];
+      $table[$name]['format']['type']['#wrapper_attributes']['class'] = ['visually-hidden'];
๐Ÿ› Bug report
Status

Fixed

Version

3.4

Component

User interface

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States jeremycaldwell

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024