Problem/Motivation

The is a follow up to #1272990: Make tabledrag warning message show when row weights are enabled, and add WAI-ARIA live region which was committed to Drupal 8.0.

It was then re-opened in #1272990-22: Make tabledrag warning message show when row weights are enabled, and add WAI-ARIA live region to consider the use of Drupal.announce instead of role="alert". Refer to that comment and the following discussions for more information.

Steps to reproduce

Proposed resolution

Decide if Drupal.announce should be used Drupal announce is overkill as adding role="alert" to the element displaying accomplishes the same thing.

Remaining tasks

TBD

User interface changes

TBD

API changes

TBD

Data model changes

TBD

Release notes snippet

TBD

CommentFileSizeAuthor
#2 tabledrag-alert-1272990-79.patch1.37 KBquietone

Comments

quietone created an issue. See original summary.

quietone’s picture

StatusFileSize
new1.37 KB

This is the latest patch from the other issue, it made with 8.2.x.

lendude’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Accessibility

Taking my comment from #1272990: Make tabledrag warning message show when row weights are enabled, and add WAI-ARIA live region

This now seems to come down to support for role="alert" vs using Drupal.announce. The role="alert" change landed in #20.
We are almost 10 years on from when this landed, is support for this still lacking, or are we okay now with relying on role="alert"?

We need more info on the direction before we can move this forward, so postponing for now.

bnjmnm’s picture

Unless there's evidence that role="alert" is inferior to using aria-live="assertive" (what Drupal.announce() uses) for conveying important information to AT, this should remain as-is. The message needs to be visible, so there's no point in sending the same string to Drupal.announce() unless there's proven issues with role="alert", especially since the current logic is in a theme function - a function that ideally generates markup and does nothing else.

On paper, they are supposed to function similarly. I see in #1272990: Make tabledrag warning message show when row weights are enabled, and add WAI-ARIA live region there's a comment saying role="alert" "does not have great support", but it's quite possible browsers/AT have caught up in the 7 years, especially considering that role="alert" is used to convey form validation errors and that was not met with concern.

I wasn't able to find any evidence that role="alert" is lacking in any of Drupal's supported browsers, but it's possible it isn't documented or the issue is on the AT side. I provided a snippet that can be used to test if role="alert" is sufficient without having to even run Drupal. Paste this into any browser console, and it will create a button that when clicked, triggers a message in a role="alert" div. If that message is successfully conveyed, there isn't a problem. I tried this out with Voiceover on all my OSX browsers, but obviously there are more combinations.

const alertButton =  document.createElement('button');
alertButton.textContent = 'create message with role="alert"';
alertButton.addEventListener('click', () => {
const div = document.createElement('div');
div.setAttribute('role', 'alert');
div.textContent = 'I am a message that should be conveyed to AT because I am in role alert';
  document.body.append(div);
});
document.body.append(alertButton);
mgifford’s picture

Best reference I know on aria-live usage is:
https://a11ysupport.io/tests/tech__aria__aria-live

I haven't seen any comparisons of role="alert" and aria-live="assertive"

bnjmnm’s picture

Issue summary: View changes

I previously tested all my Mac browsers with Voiceover (FF, Opera, Chrome, Safari), and I just tested Edge/Firefox/Chrome in Windows using Narrator/Jaws/NVDA. Adding the alert role functions identically to aria-live="assertive" (and thus works identically to Drupal.announce() set to assertive), so a role="alert" can be added to the element displaying the warning and it is accessible. Go ahead and change the role. It sounds like there were issues at some point with role="alert" when it was mentioned in that other issue in but as one would hope things improved in the decade that followed.

mgifford’s picture

Issue tags: +wcag331

Looks like an error identification error handling issue to me https://www.w3.org/WAI/WCAG21/Understanding/error-identification

Version: 10.0.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

lendude’s picture

Status: Postponed (maintainer needs more info) » Needs work

Thanks for the feedback, pretty clear on the next steps! Moving this to needs work.

nlisgo’s picture

@Lendude, since you marked this issue as postponed in #3 the only comment that possibly calls for any next steps are in #7. And the next steps are not clear to me, could you perhaps update the issue summary?

lendude’s picture

Status: Needs work » Closed (works as designed)

@nlisgo ha! good point, I miss read/remembered what needed to be done here.

So the conclusion in #6 was that role='alert' is fine, I thought the next step was to add that, but we already add that, so we don't need to do anything here, I think. So closing this. Please feel free to reopen this is you think there is still work that needs to be done here

nlisgo’s picture

@Lendude. Thanks for the quick followup. I was scratching my head on what the obvious next step was. I agree with outcome.

nlisgo’s picture

@mgifford I see you have tagged this issue wcag331 are you happy with this outcome?