-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include how to make accordion open by default #4331
base: main
Are you sure you want to change the base?
Conversation
Added content to explain how to make the sections open by default
✅ You can preview this change here:Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
I don't think this behaviour is built into GOV.UK Frontend? You can add the Having a special ID triggering this behaviour would mean that you couldn't have multiple accordions defaulting to open and storing the section open state in a single service, because the ID is used as a key for the open state and has to be unique for each accordion |
Ah ok sorry I've got the instructions wrong. But it's just that the page
says 'You can configure sections to start and stay open, but not stay
closed.' - but it doesn't tell you how to do that/mention the
govuk-accordion__section--expanded class.
It explains how to turn off the session remembering which sections were
open but not starting with them open, which is confusing as the heading of
that section is 'Starting with sections open'.
I'll try rewriting the instructions
…On Thu, 28 Nov 2024 at 17:00, Matt Eason ***@***.***> wrote:
I don't think this behaviour is built into GOV.UK Frontend?
You can add the govuk-accordion__section--expanded class to the
govuk-accordion__section div to default individual sections to open (
https://github.com/alphagov/govuk-frontend/blob/1ac6988d3d9e83a1ee156a8483b6668f8a861cca/packages/govuk-frontend/src/govuk/components/accordion/template.njk#L6),
or use the expanded option on an item in the Nunjucks templates, but I
don't think there's anything special about the ID accordion-expanded
which would trigger all sections to open.
Having a special ID triggering this behaviour would mean that you couldn't
have multiple accordions storing the section open state in a single
service, because the ID is used as a key for the open state and has to be
unique for each accordion
—
Reply to this email directly, view it on GitHub
<#4331 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BMQWGCA626QRRY6YZFYIPQT2C5D2RAVCNFSM6AAAAABSOIKWH6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMBWGUYTSMZVGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
*Samantha Wright (My pronouns are she/her) *
*Senior Interaction Designer - Prisons Digital*
***@***.***
07476272827
Find me on *People Finder*
<https://peoplefinder.service.gov.uk/people/sam-wright>
*A flexible organisation, driven by data, led by users*
|
Added content to explain how to make the sections open by default