Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sbb-tag, sbb-tag-group): implement native form support #3379

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ snapshots["sbb-tag-group renders DOM"] =
size="m"
>
<sbb-tag
aria-pressed="false"
data-action=""
data-button=""
data-slot-names="unnamed"
Expand All @@ -19,7 +18,6 @@ snapshots["sbb-tag-group renders DOM"] =
First tag
</sbb-tag>
<sbb-tag
aria-pressed="false"
data-action=""
data-button=""
data-slot-names="unnamed"
Expand All @@ -33,7 +31,6 @@ snapshots["sbb-tag-group renders DOM"] =
<div slot="li-2">
</div>
<sbb-tag
aria-pressed="false"
data-action=""
data-button=""
data-slot-names="unnamed"
Expand Down Expand Up @@ -84,18 +81,15 @@ snapshots["sbb-tag-group renders A11y tree Chrome"] =
"children": [
{
"role": "button",
"name": "First tag",
"pressed": false
"name": "First tag"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am worried that the pressed state is not reflected anymore. Do you know the cause?

},
{
"role": "button",
"name": "Second tag",
"pressed": false
"name": "Second tag"
},
{
"role": "button",
"name": "Third tag",
"pressed": false
"name": "Third tag"
}
]
}
Expand All @@ -110,15 +104,15 @@ snapshots["sbb-tag-group renders A11y tree Firefox"] =
"name": "",
"children": [
{
"role": "toggle button",
"role": "button",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm it doesn't seem to be recognized as toggle button anymore. Could this be preserved?

"name": "First tag"
},
{
"role": "toggle button",
"role": "button",
"name": "Second tag"
},
{
"role": "toggle button",
"role": "button",
"name": "Third tag"
}
]
Expand Down
5 changes: 5 additions & 0 deletions src/elements/tag/tag-group/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ const uncheckTags = () => {
</sbb-tag-group>
```

## States

The component can disable all slotted `sbb-tag`s by setting the `disabled` property to `true`.

## Accessibility

The property `listAccessibilityLabel` is forwarded as `aria-label` to the inner list that the component uses to display the tags,
Expand All @@ -105,6 +109,7 @@ that communicates the collective meaning of all `sbb-tag`s.

| Name | Attribute | Privacy | Type | Default | Description |
| ------------------------ | -------------------------- | ------- | -------------------------------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `disabled` | `disabled` | public | `boolean` | `false` | Whether the component is disabled. |
MarioCastigliano marked this conversation as resolved.
Show resolved Hide resolved
| `listAccessibilityLabel` | `list-accessibility-label` | public | `string` | `''` | This will be forwarded as aria-label to the inner list. |
| `multiple` | `multiple` | public | `boolean` | `false` | If set multiple to false, the selection is exclusive and the value is a string (or null). If set multiple to true, the selection can have multiple values and therefore value is an array. Changing multiple during run time is not supported. |
| `size` | `size` | public | `SbbTagSize` | `'m' / 's' (lean)` | Tag group size, either s or m. |
Expand Down
Loading
Loading