Google CSE markup inaccessible

Created on 11 June 2021, about 3 years ago
Updated 29 June 2023, 12 months ago

Problem/Motivation

The HTML elements added to the page by the google_cse library are not accessible in the following ways:

1) Search form: The search button is not labeled. A screen reader user will only hear "button" and be unsure or completely misunderstand what this button will do.

2) Search results: Sort by filter button is not labelled properly for screen readers or speech recognition users. (Divs containing text should be replaced with an actual select element, links, or clearly-labeled buttons.)

3) Search results: Tabs are visually apparent, but their roles are not conveyed and properly coded for a screen reader user. All a screen reader user hears is "Search" link or "X link" instead of "Search tab" etc. (Aria and role attributes and should be added)

Proposed resolution

Our sites are required to be accessible, so I was planning on implementing a JavaScript approach that would alter the markup on to the page (after it was added by CSE) to make it accessible.

I was initially thinking of doing this as a stand-alone module that we would require for any site using CSE, but then it occurred to me that it might be better if the solution was included in this module (perhaps a setting, enabled by default).

If this sounds like a reasonable approach, we'll begin work on a patch.

✨ Feature request
Status

Closed: works as designed

Version

3.0

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States jenlampton

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.

  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

    With some time behind us to let this consideration breathe, I reach the conclusion that the current stance of the maintainers of the Google PSE module is that the rendered output provided by Google is not something that is in scope for this module.

    Reiterating that one new solution to deal with Google's inaccessible markup is a new Drupal module that uses the Google PSE JSON API, returning the search results as data, rather than markup: https://www.drupal.org/project/google_json_api β†’

    Closing as "Works as designed."

Production build 0.69.0 2024