From 1f52e958bc276a2368671b90e3c2167289c60a3a Mon Sep 17 00:00:00 2001 From: Peter Hartree Date: Mon, 5 Apr 2021 12:23:41 +0100 Subject: [PATCH 1/3] Add example: Panels stay open [Google search](https://www.google.com/search?q=bootstrap+accordion+multiple+open&client=firefox-b-d&sxsrf=ALeKk00NAcXPdN5XQmzsi5Bp8m63rMDf5A%3A1617620859599&ei=e-9qYKeVJOCN9u8Pw4Sl6AM&oq=bootstrap+accordion+multiple+open&gs_lcp=Cgdnd3Mtd2l6EAMyAggAMgYIABAHEB4yBggAEAcQHjIGCAAQBRAeMgYIABAIEB46BwgjELADECc6BwgAEEcQsANQq50yWL-eMmD7nzJoAXACeACAAaIBiAHJApIBAzIuMZgBAKABAaoBB2d3cy13aXrIAQnAAQE&sclient=gws-wiz&ved=0ahUKEwjnvt6l--bvAhXghv0HHUNCCT0Q4dUDCAw&uact=5) suggests that quite a lot of people want to do this. To figure this out, you currently have to go read the [options section on the Collapse page](https://getbootstrap.com/docs/5.0/components/collapse/#options). --- site/content/docs/5.0/components/accordion.md | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/site/content/docs/5.0/components/accordion.md b/site/content/docs/5.0/components/accordion.md index 864ff90c5464..7f01345e9ce5 100644 --- a/site/content/docs/5.0/components/accordion.md +++ b/site/content/docs/5.0/components/accordion.md @@ -101,6 +101,51 @@ Add `.accordion-flush` to remove the default `background-color`, some borders, a {{< /example >}} +### Panels stay open + +Omit the `data-bs-parent` attribute to make panels stay open when another panel is opened. + +{{< example >}} +
+
+

+ +

+
+
+ This is the first item's accordion body. It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. +
+
+
+
+

+ +

+
+
+ This is the second item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. +
+
+
+
+

+ +

+
+
+ This is the third item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. +
+
+
+
+{{< /example >}} + ## Accessibility Please read the [collapse accessibility section]({{< docsref "/components/collapse#accessibility" >}}) for more information. From 7319c2f42f47325f9970b26bf25ea77fc1670582 Mon Sep 17 00:00:00 2001 From: Peter Hartree Date: Sun, 11 Apr 2021 17:47:14 +0100 Subject: [PATCH 2/3] Set unique element IDs in the new example --- site/content/docs/5.0/components/accordion.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/site/content/docs/5.0/components/accordion.md b/site/content/docs/5.0/components/accordion.md index 7f01345e9ce5..1d3fbffe805f 100644 --- a/site/content/docs/5.0/components/accordion.md +++ b/site/content/docs/5.0/components/accordion.md @@ -106,38 +106,38 @@ Add `.accordion-flush` to remove the default `background-color`, some borders, a Omit the `data-bs-parent` attribute to make panels stay open when another panel is opened. {{< example >}} -
+
-

-

-
+
This is the first item's accordion body. It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow.
-

-

-
+
This is the second item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow.
-

-

-
+
This is the third item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow.
From 9c213d43cb530fbb264a5b04e08896167fa32a2c Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Wed, 14 Apr 2021 13:34:06 -0700 Subject: [PATCH 3/3] Update language --- site/content/docs/5.0/components/accordion.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/content/docs/5.0/components/accordion.md b/site/content/docs/5.0/components/accordion.md index 1d3fbffe805f..a4ef8272e763 100644 --- a/site/content/docs/5.0/components/accordion.md +++ b/site/content/docs/5.0/components/accordion.md @@ -101,9 +101,9 @@ Add `.accordion-flush` to remove the default `background-color`, some borders, a
{{< /example >}} -### Panels stay open +### Always open -Omit the `data-bs-parent` attribute to make panels stay open when another panel is opened. +Omit the `data-bs-parent` attribute on each `.accordion-collapse` to make accordion items stay open when another item is opened. {{< example >}}