Skip to content

Commit 41f2947

Browse files
committed
chore: update interactive card
1 parent 4fe9e4a commit 41f2947

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

docs/migration/v2.x.x-to-v3.0.0.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,29 @@ Please provide the correct `type` property in your code anyhow as a best practis
1616
We removed the `state` property from the `db-button`/`DBButton` component for now.
1717
It wasn't implemented in any framework causing some confusion, and we will reintroduce it in a future version.
1818

19+
## db-card/DBCard
20+
21+
### `behavior='interactive'` change
22+
23+
We changed the `behavior='interactive'` property not applying `role='button'` and `tabIndex` anymore.
24+
If you want to use an interactive card, you should wrap the card with the correct HTML element, like a `button` or `a` tag:
25+
26+
```html
27+
<!--Angular-->
28+
<button>
29+
<db-card behavior="interactive">
30+
<!-- card content -->
31+
</db-card>
32+
</button>
33+
34+
<!--React/Vue-->
35+
<button>
36+
<DBCard behavior="interactive">
37+
<!-- card content -->
38+
</DBCard>
39+
</button>
40+
```
41+
1942
## icon-before/-after
2043

2144
We renamed the `data-icon-after` and `data-icon-before` properties to `data-icon-trailing` and `data-icon-leading`,

packages/components/src/components/card/card.lite.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ export default function DBCard(props: DBCardProps) {
3333
data-behavior={props.behavior}
3434
data-elevation-level={props.elevationLevel}
3535
data-spacing={props.spacing}
36-
role={props.behavior === 'interactive' ? 'button' : undefined}
37-
tabIndex={props.behavior === 'interactive' ? 0 : undefined}
3836
onClick={(event: ClickEvent<HTMLElement>) =>
3937
state.handleClick(event)
4038
}>

0 commit comments

Comments
 (0)