From 2bdd1f1eebab601b88c4d8f8ca370a177a47efca Mon Sep 17 00:00:00 2001
From: rmccar <42928680+rmccar@users.noreply.github.com>
Date: Wed, 6 Nov 2024 09:50:43 +0000
Subject: [PATCH] Fix lighthouse hub and spoke test (#3410)
---
src/components/summary/_macro-options.md | 12 ++++++------
src/components/summary/_macro.njk | 8 ++++----
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/components/summary/_macro-options.md b/src/components/summary/_macro-options.md
index 52c01010b1..5b468576bb 100644
--- a/src/components/summary/_macro-options.md
+++ b/src/components/summary/_macro-options.md
@@ -53,12 +53,12 @@
## SummaryAction
-| Name | Type | Required | Description |
-| ------------------ | ------ | -------- | ------------------------------------------------------------------------------------------- |
-| text | string | true | Text for the action link |
-| url | string | true | The URL for the HTML `href` attribute of the link used to change the value of the row item |
-| attributes | object | false | HTML attributes (for example, data attributes) to add to the action link |
-| visuallyHiddenText | string | false | Visually hidden text in a span under the action link to add more context for screen readers |
+| Name | Type | Required | Description |
+| ------------------ | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------- |
+| text | string | true | Text for the action link |
+| url | string | true | The URL for the HTML `href` attribute of the link used to change the value of the row item |
+| attributes | object | false | HTML attributes (for example, data attributes) to add to the action link |
+| visuallyHiddenText | string | false | Visually hidden text in a span under the action link to add more context for screen readers, , defaults the text in `text` param |
## SummaryLink
diff --git a/src/components/summary/_macro.njk b/src/components/summary/_macro.njk
index 33ba88d346..8d3708d08d 100644
--- a/src/components/summary/_macro.njk
+++ b/src/components/summary/_macro.njk
@@ -112,10 +112,10 @@
class="ons-summary__button"
{% if action.attributes %}{% for attribute, value in (action.attributes.items() if action.attributes is mapping and action.attributes.items else action.attributes) %}{{ ' ' }}{{ attribute }}="{{ value }}"{% endfor %}{% endif %}
>
-
- {{- action.text -}}
-
- {{ action.visuallyHiddenText }}
+ {{- action.text -}}
+ {{ action.visuallyHiddenText | default (action.text) }}
{% endfor %}