From b6e6e32497eaab041b78099ca83796d36b88ebfc Mon Sep 17 00:00:00 2001 From: "James Rushford (Work)" Date: Thu, 22 May 2025 07:36:58 +0200 Subject: [PATCH] feat(GlDisclosureDropdown): add forceUlTag prop Add the forceListContainer prop to GlDisclosureDropdown which allows explicitly forcing a UL container --- .../disclosure/disclosure_dropdown.md | 27 ++++++++++++++++++- .../disclosure/disclosure_dropdown.spec.js | 12 +++++++++ .../disclosure/disclosure_dropdown.vue | 9 +++++++ 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.md b/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.md index 362d4694e7..ee92c00cd5 100644 --- a/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.md +++ b/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.md @@ -67,7 +67,7 @@ It's possible to close the disclosure dropdown programmatically by calling the ` `close` methods on the disclosure dropdown via a template ref. For example: ```js -this.$refs.disclosureDropdown.closeAndFocus() +this.$refs.disclosureDropdown.closeAndFocus(); ``` The `closeAndFocus` method is preferred in most cases, especially when triggering it from some action @@ -181,3 +181,28 @@ In this case the user is responsible for handling all events and navigation insi ## Split dropdown See [button group documentation](/docs/base-button-group--docs#split-dropdowns). + +## Container element type + +The disclosure dropdown automatically determines the appropriate container element type based on its +content: + +- When the dropdown contains only list items (`gl-disclosure-dropdown-item`, + `gl-disclosure-dropdown-group`, or direct `li` elements), it renders a semantic `