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

Add Craft.cp.announce() and implement for various loading states #15569

Merged
merged 14 commits into from
Aug 29, 2024

Conversation

gcamacho079
Copy link
Contributor

@gcamacho079 gcamacho079 commented Aug 20, 2024

Description

Previously, we had live regions that were very localized (i.e., one for element indexes, live regions attached to buttons like the MultiFunctionBtn, etc.). This PR attempts to simplify screen reader announcements for status messages by:

  • Adding a method for making screen reader accessible announcements
  • Setting a default live region when initializing the control panel (#global-live-region)
  • Adding a live region to the Slideout component (in addition to the Modal live region implemented by @i-just)
  • Listening for the addition/removal of modal layers and modifying the active live region accordingly; this is important because activating a modal layer hides other layers (including the #global-live-region and contents of previous layers) from assistive technology.

Related issues

Resolves PT-2091, PT-2062, PT-2064, PT-2063, PT-2060, PT-2089, PT-2031

@gcamacho079 gcamacho079 added the accessibility 👤 features related to accessibility label Aug 20, 2024
… the button; add loading message on add passkey click
Lupe Camacho added 2 commits August 26, 2024 15:22
…s, use Craft announcer in PreviewFileModal.js
… set as the active live region; cleanup attributes
Copy link

linear bot commented Aug 27, 2024

@gcamacho079 gcamacho079 changed the title A11y/fixes Add Craft.cp.announce() and implement for various loading states Aug 27, 2024
@gcamacho079 gcamacho079 marked this pull request as ready for review August 27, 2024 18:03
Copy link
Contributor

@brianjhanson brianjhanson left a comment

Choose a reason for hiding this comment

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

Looks good! It could be useful to split the announce function out from the Craft.cp object, but that's probably for down the road.

@gcamacho079
Copy link
Contributor Author

Looks good! It could be useful to split the announce function out from the Craft.cp object, but that's probably for down the road.

Thank you for reviewing @brianjhanson. Where do you think it would be best to move it to?

@brianjhanson
Copy link
Contributor

Looks good! It could be useful to split the announce function out from the Craft.cp object, but that's probably for down the road.

Thank you for reviewing @brianjhanson. Where do you think it would be best to move it to?

Excellent question and why I think it's for a separate PR. It would probably make the most sense as a separate package but we don't have any of the infrastructure in place for that yet.

[ci skip]
@brandonkelly brandonkelly merged commit 84ba503 into 5.4 Aug 29, 2024
@brandonkelly brandonkelly deleted the a11y/fixes branch August 29, 2024 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility 👤 features related to accessibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants