Skip to content

Commit a580080

Browse files
authored
fix: a11y warning on CardView (#8496)
* fix: a11y warning on CardView * fix standalone case
1 parent 2e8838c commit a580080

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/@react-spectrum/card/src/CardBase.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const CardBase = React.forwardRef(function CardBase<T extends object>(pro
3939
let {
4040
isQuiet,
4141
orientation = 'vertical',
42-
articleProps = {},
42+
articleProps = {role: 'article'},
4343
item,
4444
layout,
4545
children
@@ -115,7 +115,7 @@ export const CardBase = React.forwardRef(function CardBase<T extends object>(pro
115115

116116
return (
117117
<FocusRing focusRingClass={classNames(styles, 'focus-ring')}>
118-
<article
118+
<div
119119
{...styleProps}
120120
{...mergeProps(cardProps, focusWithinProps, hoverProps, filterDOMProps(props), articleProps)}
121121
ref={domRef}
@@ -151,7 +151,7 @@ export const CardBase = React.forwardRef(function CardBase<T extends object>(pro
151151
</SlotProvider>
152152
<div className={classNames(styles, 'spectrum-Card-decoration')} />
153153
</div>
154-
</article>
154+
</div>
155155
</FocusRing>
156156
);
157157
});

0 commit comments

Comments
 (0)