You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ui/components/menus/docs.mdx
+59-53Lines changed: 59 additions & 53 deletions
Original file line number
Diff line number
Diff line change
@@ -20,49 +20,13 @@ The unordered menu list `<ul>` with `[role="menu"]` should be contained in a `<d
20
20
21
21
The target HTML element and dropdown need to be wrapped in the class `.slds-dropdown-trigger dropdown-trigger_click`.
22
22
23
-
## Positioning
24
-
25
-
There are 3 options for the positioning of the menu dropdown -- left, right, and bottom. To access these options, add a modifier to the `<div>` with class name `slds-dropdown`. For the standard positioning where the dropdown aligns with the left side of the dropdown trigger, use `slds-dropdown_left`, as seen above.
To adjust the width of the menu dropdown add modifier `slds-dropdown_*` to the `<div>` with class `slds-dropdown` where the `*` is `xx-small`, `x-small`, `small`, `medium`, or `large`.
In order to open the submenu, set `aria-expanded` to `true` on the`<a>`within the `<li>`when the user clicks or hovers over the list item, or presses enter while focused on the list item.
140
+
Any menu item that opens a submenu must have `aria-haspop="true"` on the `<a>` within the `<li>`. In order to open the submenu, set `aria-expanded` to `true` on that`<a>` when the user clicks or hovers over the list item, or presses enter while focused on the list item. Additionally, the submenu should have `role="menu"` and an `aria-label` attribute whose value matches the name of the <li> that opened the submenu.
<ulclass="slds-dropdown__list"role="menu"aria-label="Name of Item that Opened this Menu">
150
+
...
151
+
</ul>
152
+
</div>
184
153
</li>
185
154
</CodeBlock>
186
155
@@ -214,19 +183,56 @@ For an overflow of action items, use the overflow menu with actions styling by a
214
183
</CodeView>
215
184
</Example>
216
185
186
+
## Positioning
187
+
188
+
There are 3 options for the positioning of the menu dropdown -- left, right, and bottom. To access these options, add a modifier to the `<div>` with class name `slds-dropdown`. For the standard positioning where the dropdown aligns with the left side of the dropdown trigger, use `slds-dropdown_left`, as seen above.
To adjust the width of the menu dropdown add modifier `slds-dropdown_*` to the `<div>` with class `slds-dropdown` where the `*` is `xx-small`, `x-small`, `small`, `medium`, or `large`.
The main thing that distinguishes menus from other popover blocks is keyboard navigation: elsewhere, users press the Tab key to navigate through actionable items, but in a menu, users press the arrow keys to navigate.
220
233
### Expected markup
221
234
- Menu trigger is a focusable element (`<a>` or `<button>`) with `aria-haspopup="true"`
222
-
- Menu has `role="menu"` and an `aria-labelledby` attribute whose value is the id of the menu trigger
235
+
- Menu has `role="menu"` and an `aria-label` attribute whose value is the name of the menu trigger
223
236
- Menu items have `role="menuitem"`, `role="menuitemcheckbox"`, or `role="menuitemradio"`
224
237
- Menu items that open a submenu have both `aria-haspop="true"` and `aria-expanded` set to true or false on the `<a>` within the `<li>`, depending if the submenu is open or closed
225
-
- Submenu has `role="menu"` and an `aria-labelledby` attribute whose value matches the name of the `<li>` that opened the submenu
226
-
### Expected keyboard interactions
227
-
- Arrow keys cycle focus through menu items (you should use JS to disable focus for any disabled items)
228
-
- If a menu item opens a submenu, pressing enter or the right arrow key opens the submenu and focus goes to the first item in the submenu
229
-
- If a submenu is open, pressing the left arrow key or Esc key closes the submenu and puts focus back on the menu item that opened the submenu
230
-
- Tab key closes menu and moves focus to the next focusable element on the page
231
-
- Esc key closes menu and moves focus back to the menu trigger
232
-
- Any character key moves focus to the next menu item that starts with that character, if applicable
238
+
- Submenu has `role="menu"` and an `aria-label` attribute whose value matches the name of the `<li>` that opened the submenu
Copy file name to clipboardExpand all lines: ui/components/path/_doc.scss
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,7 @@
31
31
* - `left` and `right` arrow keys move focus _and_ selection, with `aria-selected="true"`
32
32
*
33
33
* **Responsive path**
34
+
*
34
35
* When the Path needs to be placed in a more narrow column on desktop (between 360px and 564px) the class `.slds-region_small` should be placed on the container so it can adapt. If the container is between 565px and 1280px, the class `.slds-region_medium` should be applied.
35
36
*
36
37
* @summary A process component communicates to the user the progress of a particular process.
Copy file name to clipboardExpand all lines: ui/components/pills/base/_index.scss
-16Lines changed: 0 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -2,22 +2,6 @@
2
2
// Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license
3
3
4
4
/**
5
-
* To create a pill, apply the `.slds-pill` class on a `<span>`.
6
-
*
7
-
* Depending on your context, you will either need a linked pill or a pill option inside of a listbox.
8
-
*
9
-
* For linked pills, a modifier class of `slds-pill--link` needs to be added to the existing `<span>` with the classname of `slds-pill`. You need an `<a>` inside of the span with the `slds-pill--link` class. The `<a>` will get the classname of `slds-pill__action`. This will treat the interactions differently from an unlinked pill option inside of a listbox.
10
-
*
11
-
* For both linked pills and unlinked pill options, a `<span>` with the classname of `slds-pill__label` should contain the string of text describing the pill object.
12
-
*
13
-
* Note, that a linked pill should not be used as a pill option inside of a listbox.
14
-
*
15
-
* Additionally, a pill can have an icon or image that sits to the left-hand side of the `.slds-pill__label`. That icon or image should receive the class `.slds-pill__icon_container`.
16
-
*
17
-
* You may also want the functionality to remove the pill as a selection. An "X" icon is normally used and will sit to the right-hand side of the `.slds-pill__label`. That icon should receive the class `.slds-pill__remove`.
18
-
*
19
-
* A `.slds-pill_container` can be used as a visual container for multiple pill(s).
0 commit comments