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(MessageBox): Announce new messages #229

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

rebeccaalpert
Copy link
Member

@rebeccaalpert rebeccaalpert commented Oct 12, 2024

Messages should be announced to assistive devices. I added a prop to MessageBox to allow for this and updated our two demos with message sending so they make announcements. I also documented this in the Chatbot container docs. I checked this worked with VoiceOver, but I can't speak to any other tools.

Taking this opportunity to also switch our scrolling method and add better ids.

@patternfly-build
Copy link

patternfly-build commented Oct 12, 2024

@rebeccaalpert rebeccaalpert force-pushed the a11y-217 branch 4 times, most recently from d73542c to d81a5ff Compare October 12, 2024 00:58
Messages should be announced to assistive devices. I added a prop to MessageBox to allow for this and updated our two demos with message sending so they make announcements. I also documented this in the Chatbot container docs. I checked this worked with VoiceOver, but I can't speak to any other tools.
@@ -72,6 +78,9 @@ const MessageBox: React.FunctionComponent<MessageBoxProps> = ({ children, classN
<JumpButton position="top" isHidden={isOverflowing && atTop} onClick={scrollToTop} />
<div className={`pf-chatbot__messagebox ${className ?? ''}`} ref={messageBoxRef}>
{children}
<div className="pf-chatbot__messagebox-announcement" aria-live="polite">
Copy link
Contributor

Choose a reason for hiding this comment

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

If this always exists on the page, I wonder if it could be set programatically (if an announcement is not passed by default. Like could we provide an out of the box default that reads out the new announcement?)

I think that could be a resonable follow up for the future.

@nicolethoen nicolethoen merged commit 0a08589 into patternfly:v6 Oct 14, 2024
7 checks passed
Copy link

🎉 This PR is included in version 2.0.0-alpha.54 🎉

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

a11y - Announce new content in message area Auto-scroll chat does not account for large volume bot responses
3 participants