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

fix: add close button accessible name props to ToastNotification #462

Merged

Conversation

maxinteger
Copy link
Collaborator

@maxinteger maxinteger commented May 17, 2024

Description

Add new prop to ToastNotification to fix the missing accessible label on the close button

Links

https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-505339

@@ -14,7 +14,8 @@ import Text from '../Text';
* The ToastNotification component.
*/
const ToastNotification: FC<Props> = (props: Props) => {
const { className, id, style, content, leadingVisual, buttonGroup, onClose } = props;
const { className, id, style, content, leadingVisual, buttonGroup, onClose, closeButtonLabel } =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this case gives us the perfect opportunity to have a default arialabel for the button "Close notification". X buttons in notification toasts, if pressent, will always need an aria label. So if we are making this prop optional (which is good imo), then we should add a default value.

add default label to the close button
@maxinteger maxinteger merged commit 822ece5 into master May 17, 2024
5 checks passed
@maxinteger maxinteger deleted the fix/SPARK-505339-add-toastnotification-close-btn-label-prop branch May 17, 2024 15:48
Copy link

🎉 This PR is included in version 26.101.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants