Problem/Motivation
There's an aria-live region in the toolbar, this is the JS that generates it:
<div aria-live="polite" data-drupal-selector="ckeditor5-admin-help-message">
<p>${helpMessage.join('</p><p>')}</p>
</div>
The help message it provides is currently one of these two things, based on whether or not the "wrapping item is in use":
- "The toolbar buttons that don't fit the user's browser window width will be grouped in a dropdown. If multiple toolbar rows are preferred, those can be configured by adding an explicit wrapping breakpoint wherever you want to start a new row.",
- 'You have configured a multi-row toolbar by using an explicit wrapping breakpoint. This may not work well in narrow browser windows. To use automatic grouping, remove any of these divider buttons.',
This only needs to be conveyed once, unless the presence of the "wrapping" item changes, which should result in the message changing and that being conveyed to AT.
THE PROBLEM
This aria-live region is part of the area re-rendered any time an item is moved within the toolbar config. As a result the "The toolbar buttons that don't fit..." announcement is conveyed to AT after ANY change to toolbar config. Because it's a new+regenerated aria-live region, there's no awareness that the message is unchanged and it's re-conveyed. This is a problem regardless, but it's particularly disruptive since the message being conveyed is about a very specific use case that is unlikely to reflect what the user is actually doing.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3270112
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3270112-excessive-aria-live-announcing
changes, plain diff MR !1982
Comments
Comment #2
bnjmnmComment #4
bnjmnmComment #5
wim leersaria-live="polite", we're omitting that attribute and doing an explicitDrupal.announce()(which defaults topolite). So instead of letting the browser/AT detect a changed "aria live polite" and having it read it automatically, we're explicitly doing it in code, because we know this piece in the DOM is changing frequently, and would overwhelm the user.Comment #9
lauriiiCommitted a6ee1a1 and pushed to 10.0.x. Also cherry-picked to 9.4.x and 9.3.x. Thanks!