-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(modal): support alertdialog aria role #5955
feat(modal): support alertdialog aria role #5955
Conversation
My decision behind adding a new prop to control this behavior was that, although |
Deploy preview for carbon-elements ready! Built with commit 057618c |
c43ea50
to
e8a7a27
Compare
Deploy preview for carbon-components-react ready! Built without sensitive environment variables with commit c43ea50 https://deploy-preview-5955--carbon-components-react.netlify.app |
Deploy preview for carbon-components-react ready! Built without sensitive environment variables with commit 057618c https://deploy-preview-5955--carbon-components-react.netlify.app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good to me, but is there a ticket associated with this PR? just trying to get some additional context for this change
Sorry, I completely glanced over the note in the guidelines that I should have created an issue. I can create one to provide some example codes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @FrivalszkyP thank you for jumping in! After comparing the purpose of alertdialog
role and our modal usage guide, I'm inclined to believe that the alertdialog
should be applied to all passiveModal
variants. What do you think?
@asudoh the attritbute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may need to distinguish passive or active modals here. With passive modals not needing a users response simply being role="alert"
and active modals requiring a response being role="alertdialog"
since there is this distinction in our design guidance.
@dakahn Good call, do you suggest changing the role to |
e8a7a27
to
1bccc2a
Compare
Thanks! I updated the PR with the role="alert" functionality. |
1bccc2a
to
a3b786d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks a lot for taking this on. 🏄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM as well, thanks for adding! 👍 ✅
Closes #5960
There is an alertdialog role in ARIA which is described as this:
Much like role="alert", it will be read out by screen reader software immediately when displayed.
Changelog
New
alert
prop to the react implementation of Modal.jsTesting / Reviewing
See Carbon React Storybook where I added a knob for controlling the alert prop.