Skip to content

Commit 130453c

Browse files
committed
Clarify docs when@matchToggleWidth and @width are both set
1 parent 2d017e6 commit 130453c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

website/docs/components/dropdown/partials/code/component-api.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,13 @@ The Dropdown component is composed of different child components each with their
7676
<C.Property @name="width" @type="string" @valueNote="any valid CSS width (px, rem, etc)">
7777
By default, the Dropdown List has a `min-width` of `200px` and a `max-width` of `400px`, so it adapts to the content size. If a `@width` parameter is provided then the list will have a fixed width.
7878
<br/><br/>We discourage the use of percentage values for this argument. The Dropdown list is [a `popover` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/popover), so relative units use `document` as a reference (not the parent element), meaning percentage values act similar to `vw`.
79+
If `@matchToggleWidth` is set, `@width` is overridden.
7980
</C.Property>
8081
<C.Property @name="height" @type="string" @valueNote="any valid CSS height (px, rem, etc)">
8182
If a `@height` parameter is provided then the list will have a max-height.
8283
</C.Property>
8384
<C.Property @name="matchToggleWidth" @type="boolean" @default="false">
84-
Sets the Dropdown List’s width to match the width of the Toggle.
85+
Sets the Dropdown List’s width to match the width of the Toggle. It overrides the `@width` value if set.
8586
</C.Property>
8687
<C.Property @name="preserveContentInDom" @type="boolean" @default="false">
8788
Controls if the content is always rendered in the DOM, even when the Dropdown is closed.

website/docs/components/dropdown/partials/code/how-to-use.md

+2
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ You can also set the width of a list to match the toggle button.
175175
</Hds::Dropdown>
176176
```
177177

178+
When `@matchToggleWidth` is set, the `@width` value (if set) is overridden.
179+
178180
### List footer
179181

180182
It is possible that you may want to add a list footer for things like a set of buttons for a filter control:

0 commit comments

Comments
 (0)