Skip to content

Virtualize component spacers are not accessible #62989

@adamint

Description

@adamint

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

CTI noticed a bug in the Aspire dashboard with row counts - dotnet/aspire#10123

The root cause of this issue is that spacers created in the Virtualize component do not have aria-hidden added to them. This should be done, as these elements are not focusable but also should not be visible to screen readers. Though this does not just affect tables, a tbody with a spacer tr element (as suggested by the SpacerElement documentation, 'when rendering inside a "tbody", consider setting to the value "tr"') will have its row count off by up to 2.

Expected Behavior

All spacers should include the attribute aria-hidden="true".

Steps To Reproduce

Repro steps in dotnet/aspire#10123, but you could also render any Virtualize with spacer elements of li inside ul/ol, or a Virtualize with spacer elements of tr inside a tbody/theader

Exceptions (if any)

No response

.NET Version

No response

Anything else?

No response

Metadata

Metadata

Labels

area-blazorIncludes: Blazor, Razor Components

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions