Bootstrap 5: table caption must be a field

Created on 31 January 2023, almost 2 years ago
Updated 8 February 2023, almost 2 years ago

Problem/Motivation

Table caption is currently a setting:

settings:
    caption:
      type: "textfield"
      label: "Caption"
      description: "A caption functions like a heading for a table. It helps users with screen readers to find a table and understand what it's about and decide if they want to read it. By default it is displayed at the bottom of the table."
      preview: "Example table (caption)"

Source: https://git.drupalcode.org/project/ui_suite_bootstrap/-/blob/5.0.x/templ...

However, accoridng to the HTML specs, thsi elemnt accept any flow content: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/caption#techni...

So, it must be a field.

Proposed resolution

fields:
    caption:
      type: "text"
      label: "Caption"
      description: "A caption functions like a heading for a table. It helps users with screen readers to find a table and understand what it's about and decide if they want to read it. By default it is displayed at the bottom of the table."
      preview:  "Caption of the table"

API changes

Careful, it is breaking change. It is OK because the theme is still in alpha, but some projects may be already using it.

🐛 Bug report
Status

Fixed

Version

5.0

Component

Code

Created by

🇫🇷France pdureau Paris

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

Comments & Activities

Production build 0.71.5 2024