Bootstrap 5: table caption must be a field

Created on 31 January 2023, over 1 year ago
Updated 8 February 2023, over 1 year 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.69.0 2024