"Add new comment" and "@count comments" links are not following accessibility good practices

Created on 10 November 2017, over 6 years ago
Updated 16 May 2023, about 1 year ago

Problem/Motivation

Since Drupal 7, the "Read more" links added by the core on the nodes teasers have been made accessible by appending them a visually-hidden indication of the node title to read more about. The same thing should be done on the "Add new comment" and "@count comments" links provided by the comment module.

This is important because screen readers users sometime navigate by jumping from link to link. If the links titles are such generic, they have no clue about where they are going to land.

Steps to reproduce

  1. Install Drupal standard
  2. Create an article, published ans promoted to front page, with title "Blah"
  3. Go to your article and add a comment
  4. Have a look at your front page source code

Expected result: <a href="/node/1#comments" title="Jump to the first comment." hreflang="en">1 comment<span class="visually-hidden"> on Blah</span></a> and <a href="/node/1#comment-form" title="Share your thoughts and opinions." hreflang="en">Add new comment<span class="visually-hidden"> about Blah</span></a>

Current result: <a href="/node/1#comments" title="Jump to the first comment." hreflang="en">1 comment</a> and <a href="/node/1#comment-form" title="Share your thoughts and opinions." hreflang="en">Add new comment</a>

Proposed resolution

Use the same trick than "Read more" links.

Remaining tasks

<!-- See https://drupal.org/core-mentoring/novice-tasks for tips on identifying novice tasks. Delete or add "Novice" from the Novice? column in the table below as appropriate. Uncomment tasks as the issue advances. Update the Complete? column to indicate when they are done, and maybe reference the comment number where they were done. -->

User interface changes

Nothing visual. Screen readers are going to find more context on "Add new comment" and "@count comments" links.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Needs work

Version

10.1 ✨

Component
CommentΒ  β†’

Last updated 2 days ago

Created by

πŸ‡«πŸ‡·France DuaelFr Montpellier, France

Live updates comments and jobs are added and updated live.
  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024