From 78227f45b69f2ab7505075a8f3b391e2d59bc1c7 Mon Sep 17 00:00:00 2001 From: rmccar <42928680+rmccar@users.noreply.github.com> Date: Tue, 10 Sep 2024 15:31:38 +0100 Subject: [PATCH] Fix custom attributes on lists with one item (#3333) --- __snapshots__/layout/_template.spec.js.snap | 4 ++++ src/components/list/_macro.njk | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/__snapshots__/layout/_template.spec.js.snap b/__snapshots__/layout/_template.spec.js.snap index b5c50684f0..cde4655d54 100644 --- a/__snapshots__/layout/_template.spec.js.snap +++ b/__snapshots__/layout/_template.spec.js.snap @@ -1395,6 +1395,7 @@ exports[`base page template matches the full configuration snapshot 1`] = ` + @@ -1470,6 +1471,7 @@ exports[`base page template matches the full configuration snapshot 1`] = ` + @@ -1545,6 +1547,7 @@ exports[`base page template matches the full configuration snapshot 1`] = ` + @@ -1635,6 +1638,7 @@ exports[`base page template matches the full configuration snapshot 1`] = ` + diff --git a/src/components/list/_macro.njk b/src/components/list/_macro.njk index 517bc3b28b..c0ec4f1a59 100644 --- a/src/components/list/_macro.njk +++ b/src/components/list/_macro.njk @@ -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 %}