Skip to content

A11y audit false positive on anchors that are not shown initially #16009

@SamuNatsu

Description

@SamuNatsu

Astro Info

Astro                    v6.0.7
Node                     v24.14.0
System                   Linux (x64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             unocss
                         html-minify
                         @astrojs/mdx
                         pagefind
                         @astrojs/sitemap

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

For an anchor, a11y audit would check innerText first

However, if the anchor is collapsed inside a <details> or is not displayed initially on the screen, the innerText would return nothing

What's the expected result?

Maybe depend on innerText is not a good idea, how about using textContent instead?

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-kcughae6?file=src%2Fpages%2Findex.astro

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    - P3: minor bugAn edge case that only affects very specific usage (priority)pkg: astroRelated to the core `astro` package (scope)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions