Skip to content

[2.18.25] Accessible Routing triggers region a11y violation in axe #20697

Closed
@wKovacs64

Description

Description

#19290 seems to have introduced an axe a11y violation, citing the new <div id="gatsby-announcer" ... /> element as not being contained within a landmark (the region rule). This only occurs after navigation has taken place and the element contains text. It does not trigger on initial page load, as there is no inner text yet.

Steps to reproduce

  1. Navigate to a new page
  2. Run axe accessibility tests (Chrome Devtools, cypress-axe, whatever)

Reproduction: https://github.com/wKovacs64/gatsby-announcer-region-test

You can check the GitHub Actions in the reproduction project to see a simple Cypress test fail after navigation has occurred, but running it locally will give you a lot more information (see screenshot below).

Expected result

No accessibility violations.

Actual result

Axe believes the region rule has been violated after navigation has occurred.

image

Environment

Run gatsby info --clipboard in your project directory and paste the output here.

  System:
    OS: Windows 10 10.0.18362
    CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
  Binaries:
    Node: 12.14.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.21.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.13.4 - C:\Program Files\nodejs\npm.CMD
  Languages:
    Python: 2.7.17 - /c/Python27/python
  Browsers:
    Edge: 44.18362.449.0
  npmPackages:
    gatsby: 2.18.25 => 2.18.25 
    gatsby-image: 2.2.39 => 2.2.39 
    gatsby-plugin-manifest: 2.2.37 => 2.2.37 
    gatsby-plugin-offline: 3.0.32 => 3.0.32 
    gatsby-plugin-react-helmet: 3.1.21 => 3.1.21 
    gatsby-plugin-sharp: 2.3.13 => 2.3.13 
    gatsby-source-filesystem: 2.1.46 => 2.1.46 
    gatsby-transformer-sharp: 2.3.13 => 2.3.13 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

type: bugAn issue or pull request relating to a bug in Gatsby

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions