Bootstrap 5, figure component: default value for figcaption_attributes

Created on 11 October 2023, 9 months ago
Updated 12 October 2023, 9 months ago

Problem/Motivation

Methods are applied without checking if figcaption_attributes exists:

<figcaption{{ figcaption_attributes.addClass('figure-caption') }}>

This is OK for now, because AttributesSettingType::preprocess() is generating empty attributes objects when empty. But this behaviour is a fragile side effect and will disappear with UI Patterns 2.

Proposed resolution

Add a default filter:

<figcaption{{ figcaption_attributes|default(create_attribute()).addClass('figure-caption') }}>

πŸ“Œ Task
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

Merge Requests

Comments & Activities

Production build 0.69.0 2024