dropdown component: simpler attributes management

Created on 18 July 2024, 5 months ago
Updated 16 August 2024, 4 months ago

Problem/Motivation

Thanks to 📌 Prevent TypeError when using create_attribute Twig function Fixed , this may not be necessary any more:

        {% set link_attributes = item.link_attributes|default(create_attribute()) %}
        {% set link_attributes = link_attributes.storage() is defined ? link_attributes : create_attribute(link_attributes) %}

Proposed resolution

Try to replace it with:

 {% set link_attributes = create_attribute(item.link_attributes|default({}) %}

Same for:

        <li{{ item.attributes.storage() is defined ? item.attributes : create_attribute(item.attributes|default({})) }}>
📌 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.71.5 2024