Skip to content

Commit acfaaa7

Browse files
committed
Closes #153 - Allow custom aria-describedby attribute
1 parent 0a6b8ea commit acfaaa7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/SnackbarItem/SnackbarItem.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class SnackbarItem extends Component {
6969
action: singleAction || singleContentProps.action || contentAction || action,
7070
};
7171

72+
const ariaDescribedby = contentProps['aria-describedby'] || 'client-snackbar';
7273
const anchOrigin = singleSnackProps.anchorOrigin || anchorOrigin;
7374

7475
let finalAction = contentProps.action;
@@ -108,9 +109,9 @@ class SnackbarItem extends Component {
108109
className,
109110
)}
110111
{...contentProps}
111-
aria-describedby="client-snackbar"
112+
aria-describedby={ariaDescribedby}
112113
message={(
113-
<span id="client-snackbar" className={classes.message}>
114+
<span id={ariaDescribedby} className={classes.message}>
114115
{!hideIconVariant ? icon : null}
115116
{snack.message}
116117
</span>

0 commit comments

Comments
 (0)