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.visuallyHiddenText }} + + {{ action.visuallyHiddenText | default (action.text) }} {% endfor %}