From 467b689eee0f038e55ec5a1da97c730063e528eb Mon Sep 17 00:00:00 2001 From: Patrick Cartlidge Date: Thu, 9 May 2024 13:50:20 +0100 Subject: [PATCH] Add documentation for 'id' to accordion component The extra documentation for the 'id' attribute that was present in the Nunjucks options table for the accordion has been added to the 'How It Works Section'. This is because if a user is just using the HTML of the accordion component, then they might not encounter the additional documentation provided for the 'id' attribute. This addresses issue #1073. --- src/components/accordion/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/accordion/index.md b/src/components/accordion/index.md index 0791edeec8..306251f5e5 100644 --- a/src/components/accordion/index.md +++ b/src/components/accordion/index.md @@ -65,6 +65,8 @@ There are 2 ways to use the accordion component. You can use HTML or, if you’r The accordion component uses JavaScript. When JavaScript is not available, users will see all the content displayed with the section labels as headings. +The 'id' attribute on the the parent div of the accordion is a required attribute. It must be unique across the domain of your service to persist the expanded state of the accordion (the state individual instances of the component persists across page loads using [session storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage)). + ### Section heading buttons An accordion will usually start with all sections hidden. To show a section, the user can interact anywhere in the heading button.