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

Close button aria-label doesn't say what the actual button does #244

Closed
johngnapp opened this issue Aug 29, 2019 · 3 comments
Closed

Close button aria-label doesn't say what the actual button does #244

johngnapp opened this issue Aug 29, 2019 · 3 comments

Comments

@johngnapp
Copy link

Hi,

The aria-label attribute for the close button is set to "toast" in ToastrBox.js. When using a screen reader this gets announced as "toast button", so it's not obvious what the button is for.

It'd be great if the attribute could be updated to "dismiss" or "dismiss message" so that it's clear what will happen when you press the button.

Thanks!

@thandrade88
Copy link

thandrade88 commented May 15, 2020

I solved doing this

options: {
...
showCloseButton: false,
        component: props => {
          return (
            <div className="rrt-right-container">
                  <button
                    onClick={props.remove}
                    tabIndex="0"
                    type="button"
                    className={`close-toastr toast-close-button toastr-control`}
                    aria-label={text you want}
                  >
                    ✕
                  </button>
            </div>
          );
}

in Options, set showCloseButton as false and in component you add a new button

@diegoddox
Copy link
Owner

Will close but feel free to reopen

@perkeletto
Copy link

For accessibility reasons it would be great if you could make it an option to give custom aria-label for the close button. "Status message....toast button" is not great result when using screen reader

atleast change it desribe the button better than "Toast button", though this would not help in my case as i need to be able to have it in my language

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

4 participants