Skip to content

Commit

Permalink
Fix custom attributes on lists with one item (#3333)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmccar authored Sep 10, 2024
1 parent 07f4ee1 commit 78227f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions __snapshots__/layout/_template.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1395,6 +1395,7 @@ exports[`base page template matches the full configuration snapshot 1`] = `







Expand Down Expand Up @@ -1470,6 +1471,7 @@ exports[`base page template matches the full configuration snapshot 1`] = `







Expand Down Expand Up @@ -1545,6 +1547,7 @@ exports[`base page template matches the full configuration snapshot 1`] = `







Expand Down Expand Up @@ -1635,6 +1638,7 @@ exports[`base page template matches the full configuration snapshot 1`] = `







Expand Down
3 changes: 2 additions & 1 deletion src/components/list/_macro.njk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
{% set listEl = 'ul' %}
{% endif %}

{% if listLength < 2 %}
{# Remove "and not params.itemsList[0].url" in future update #}
{% if listLength < 2 and not params.attributes and not params.itemsList[0].url %}
{% set attributes = params.itemsList[0].attributes %}
{% else %}
{% set attributes = params.attributes %}
Expand Down

0 comments on commit 78227f4

Please sign in to comment.