Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/green-crabs-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-components': patch
---

Fixed accessibility issue in the `<post-breadcrumbs>` component by wrapping breadcrumb items in `<li>` elements.
6 changes: 3 additions & 3 deletions packages/components/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ export namespace Components {
*/
"hide": () => Promise<void>;
/**
* Required label providing an accessible name for the menu.
* An accessible name for the menu.
*/
"label"?: string;
/**
Expand Down Expand Up @@ -1201,7 +1201,7 @@ declare namespace LocalJSX {
}
interface PostMenu {
/**
* Required label providing an accessible name for the menu.
* An accessible name for the menu.
*/
"label"?: string;
/**
Expand Down Expand Up @@ -1260,7 +1260,7 @@ declare namespace LocalJSX {
*/
"manualClose"?: boolean;
/**
* Fires whenever the popovercontainer gets shown or hidden, passing in event.detail an object containing two booleans: `isOpen`, which is true if the popovercontainer was opened and false if it was * closed, and `first`, which is true if it was opened for the first time.
* Fires whenever the popovercontainer gets shown or hidden, passing in event.detail an object containing two booleans: `isOpen`, which is true if the popovercontainer was opened and false if it was closed, and `first`, which is true if it was opened for the first time.
*/
"onPostToggle"?: (event: PostPopovercontainerCustomEvent<{ isOpen: boolean; first?: boolean }>) => void;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ post-menu::part(popover-container) {
}
}

post-breadcrumb-item:last-of-type {
li[aria-current="page"] post-breadcrumb-item {
pointer-events: none;
color: tokens.get('breadcrumb-selected-fg');
font-weight: tokens.get('breadcrumb-selected-font-weight');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export class PostBreadcrumbs {

{/* Conditionally render concatenated menu or individual breadcrumb items */}
{this.isConcatenated ? (
<div
<li
role="none"
class="menu-trigger-wrapper"
onKeyDown={e => {
Expand Down Expand Up @@ -174,19 +174,23 @@ export class PostBreadcrumbs {
))}
</post-menu>
</div>
</div>
</li>
) : (
visibleItems.map(item => (
<post-breadcrumb-item url={item.url} key={item.url || item.text}>
{item.text}
</post-breadcrumb-item>
<li>
<post-breadcrumb-item url={item.url} key={item.url || item.text}>
{item.text}
</post-breadcrumb-item>
</li>
))
)}

{this.lastItem && (
<post-breadcrumb-item url={this.lastItem.url} aria-current="page" tabindex={-1}>
{this.lastItem.text}
</post-breadcrumb-item>
<li aria-current="page">
<post-breadcrumb-item url={this.lastItem.url} tabindex={-1}>
{this.lastItem.text}
</post-breadcrumb-item>
</li>
)}
</ol>

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/post-menu/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

| Property | Attribute | Description | Type | Default |
| ----------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| `label` | `label` | Required label providing an accessible name for the menu. | `string` | `undefined` |
| `label` | `label` | An accessible name for the menu. | `string` | `undefined` |
| `placement` | `placement` | Defines the position of the menu relative to its trigger. Menus are automatically flipped to the opposite side if there is not enough available space and are shifted towards the viewport if they would overlap edge boundaries. For supported values and behavior details, see the [Floating UI placement documentation](https://floating-ui.com/docs/computePosition#placement). | `"bottom" \| "bottom-end" \| "bottom-start" \| "left" \| "left-end" \| "left-start" \| "right" \| "right-end" \| "right-start" \| "top" \| "top-end" \| "top-start"` | `'bottom'` |


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

## Events

| Event | Description | Type |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| `postToggle` | Fires whenever the popovercontainer gets shown or hidden, passing in event.detail an object containing two booleans: `isOpen`, which is true if the popovercontainer was opened and false if it was * closed, and `first`, which is true if it was opened for the first time. | `CustomEvent<{ isOpen: boolean; first?: boolean; }>` |
| Event | Description | Type |
| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| `postToggle` | Fires whenever the popovercontainer gets shown or hidden, passing in event.detail an object containing two booleans: `isOpen`, which is true if the popovercontainer was opened and false if it was closed, and `first`, which is true if it was opened for the first time. | `CustomEvent<{ isOpen: boolean; first?: boolean; }>` |


## Methods
Expand Down
Loading