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

Value provided for ContentProps['aria-describedby'] not used on Snackbar #153

Closed
ghost opened this issue Aug 15, 2019 · 2 comments
Closed

Comments

@ghost
Copy link

ghost commented Aug 15, 2019

Expected Behavior

In Material-UI snackbars, we can pass

ContentProps: {
    'aria-describedby': 'our-custom-id'
}

and that aria-describedby value will get assigned to the snackbar content wrapper. I would expect that to be the same here.

Current Behavior

In notistack, all the multiple snackbars use a default aria-describedby of #client-snackbar, regardless of what is passed via ContentProps.

Steps to Reproduce

Link: https://codesandbox.io/embed/notistack-simple-example-5t53w

  1. Use the console to inspect the element. You'll see in the source code:
<div class="MuiTypography-root-6805 MuiTypography-body1-6814 MuiPaper-root-5596 MuiPaper-elevation6-5604 MuiSnackbarContent-root-6802 SnackbarItem-base-6788" 
     role="alertdialog" 
     aria-describedby="client-snackbar" 
     direction="left" 
     style="transform: translate(0px); transition: transform 225ms cubic-bezier(0, 0, 0.2, 1) 0ms;">
    <div class="MuiSnackbarContent-message-6803">
        <span id="client-snackbar" class="SnackbarItem-message-6794">
            <span>Message 1</span>
        </span>
    </div>
    <div class="MuiSnackbarContent-action-6804">
        <button>X</button>
    </div>
</div>

Context

We have occasions in our app where we need to display multiple snackbars at a time and need unique aria tags for our accessibility requirements.

Your Environment

Tech Version
Notistack v0.8.9
React v16.8.6
Browser all
@iamhosseindhv
Copy link
Owner

Thanks for reporting this @ProtectedVoid. the fix has been published as v0.9.0

@kepamuk
Copy link

kepamuk commented Dec 25, 2019

Thanks for reporting this @ProtectedVoid. the fix has been published as v0.9.0

still not work in 0.9.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants