carbon icon indicating copy to clipboard operation
carbon copied to clipboard

Toast - should focus container rather than close button when opened

Open robinzigmond opened this issue 2 years ago • 1 comments

Desired behaviour

When opening a Toast, the focus should be placed on the toast container so that screenreader users hear the toast message. The container should not be focusable again with the keyboard and pressing tab should take the focus to the close button.

Note: even where the Toast does not have a close button, the focus should go to the toast container so that screenreader users have the message read out.

Current behaviour

Focus goes to the close button where present, since Carbon version 109.3.0. In versions prior to that, and in all versions if the toast has no close button, the toast is not focused at all. When focus goes to the close button, screenreader users just hear "close button" but no information on what they are closing.

Suggested Solution

As under "desired behaviour". Note: similar behaviour is already implemented in Dialog, DialogFullScreen, Sidebar and MenuFullScreen.

CodeSandbox or Storybook URL

https://carbon.sage.com/?path=/docs/toast--dismissible

Anything else we should know?

cc @tempertemper who requested it this morning

Confidentiality

  • [X] I confirm there is no confidential or commercially sensitive information included.

robinzigmond avatar Jul 19 '22 13:07 robinzigmond

FE-5281

sianford avatar Jul 26 '22 12:07 sianford

:tada: This issue has been resolved in version 111.12.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

carbonci avatar Nov 23 '22 09:11 carbonci