Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upSummary list #182
Comments
amyhupe
created this issue from a note
in GOV.UK Design System Community Backlog
(Published)
Jan 10, 2019
This comment was marked as resolved.
This comment was marked as resolved.
Fenwick17
commented
Jan 10, 2019
@dashouse If there is only one action it appears to still use
Did you consider the option of using a singular |
This comment was marked as resolved.
This comment was marked as resolved.
@Fenwick17 we did have a little think about this. Since some rows may have multiple actions, we thought that having them consistently as lists would allow a user to have a consistent way of interacting with the actions between rows. We could definitely only have an anchor though, what do you think? |
This comment was marked as resolved.
This comment was marked as resolved.
@nickcolley For something like a check answers page, there will typically only be one action. If there are a lot of questions on the page, that is a lot of 'list with one item'. What about putting a list inside of a list? I know it is technically possible, but does it make the screen harder to understand? Do people know what list they are in? |
This comment has been minimized.
This comment has been minimized.
@nickcolley @dashouse @amyhupe We are going to use this code for our add to list pattern but in our pattern there is no key-value pair. There is just a value used for the We thought about using a |
This comment has been minimized.
This comment has been minimized.
Or is there a way of grouping all the
|
timpaul
referenced this issue
Jan 11, 2019
Open
Publish 5 high priority components and patterns #678
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
@stevenaproctor opened an issue on your point about lists with one action: |
nickcolley
referenced this issue
Jan 13, 2019
Closed
Summary list - Can we avoid using a list for a single action? #1128
This comment was marked as resolved.
This comment was marked as resolved.
dwybourn
commented
Feb 12, 2019
We think we've found a bug where having a value with a very long value, e.g. the town 'Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch' causes the key field to be squashed. We'd expect the key field to be fixed and wrap on the values instead. We're using the summary-list nunjucks macro here https://github.com/DepartmentOfHealth-htbhf/htbhf-applicant-web-ui/blob/master/src/web/views/check.njk |
This comment has been minimized.
This comment has been minimized.
We've updated the summary list component recently:
Make sure you're on version 2.7.0 of GOV.UK Frontend to get these improvements. |
This comment was marked as resolved.
This comment was marked as resolved.
dwybourn
commented
Feb 12, 2019
We're using 2.6.0 but I've just tried 2.7.0 which has fixed the issue. Many thanks |
This comment has been minimized.
This comment has been minimized.
bill-richards
commented
Feb 12, 2019
The nunjucks template is passed the correct json for example
|
This comment has been minimized.
This comment has been minimized.
Hey @bill-richards! You're close, instead of using a string with the curly brackets, you can use Could you try doing the following: {
key: { text: "Practice Name" },
value: { text: practiceName },
actions: {
items: [
{
href: "#",
text: "Change",
visuallyHiddenText: "practice name"
}
]
}
} |
This comment has been minimized.
This comment has been minimized.
bill-richards
commented
Feb 13, 2019
Thanks for that @nickcolley, as you can tell from the time the issue was raised, I was up all night trying to get this working. |
This comment has been minimized.
This comment has been minimized.
@bill-richards glad that helped, look after yourself Bill hope you're not up late at night next time! |
This comment has been minimized.
This comment has been minimized.
bill-richards
commented
Feb 13, 2019
This approach does not work however when we specify HTML
|
This comment has been minimized.
This comment has been minimized.
bill-richards
commented
Feb 13, 2019
@nickcolley We have however discovered that if we use string concatenation then we do get the desired result. Many thanks for your clarification |
This comment has been minimized.
This comment has been minimized.
Yeah you can do that or you can take advantage of the Nunjucks set capturing {% set practiceNameHTML %}
<p class="govuk-body">{{ address.address1 }}</p>
<p class="govuk-body">{{ address.address2 }}</p>
<p class="govuk-body">{{ address.address3 }}</p>
<p class="govuk-body">{{ address.address4 }}</p>
<p class="govuk-body">{{ address.address5 }}</p>
{% endset %}
{{ govukSummaryList({
rows: [
{
key: { text: "Practice Name" },
value: {
html: practiceNameHTML
},
actions: {
items: [
{
href: "#",
text: "Change",
visuallyHiddenText: "practice name"
}
]
}
}
]
}) }} I have created an example application for you to see this in action: |
amyhupe commentedJan 10, 2019
Use this issue to discuss the summary list component.