Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(COMPONENT): Angular 19: cdk-visually-hidden does not work automatically anymore #30585

Open
1 task done
lasselindqvist opened this issue Mar 5, 2025 · 1 comment
Open
1 task done
Labels
docs This issue is related to documentation P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@lasselindqvist
Copy link

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

18

Description

https://material.angular.io/cdk/a11y/overview#hiding-elements-in-an-accessible-way

describes: If you're using Angular Material, this class is included automatically by Angular Material's theming system. Otherwise, you can include this mixin in a global stylesheet.

In an Angular project we have

  <h2 id="id" class="cdk-visually-hidden">
    text
  </h2>

and this used to be hidden in Angular 18. After automatic upgrade it became visible.

Adding

@use '@angular/cdk';

@include cdk.a11y-visually-hidden();

makes it work again, but the guide says it should work automatically as we use Angular Material.

Reproduction

StackBlitz link: https://stackblitz.com/edit/components-issue-starter-fmwfcfx3?file=src%2Fmain.ts
Steps to reproduce:

  1. Just open the main page
  2. The text is visible and it should not be. With Angular 18 it was hidden

Expected Behavior

The text should be hidden

Actual Behavior

The text is visible

Environment

  • Angular: 19.2.0
  • CDK/Material: 19.2.0
  • Browser(s): Firefox / Edge / Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows
@lasselindqvist lasselindqvist added the needs triage This issue needs to be triaged by the team label Mar 5, 2025
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent docs This issue is related to documentation and removed needs triage This issue needs to be triaged by the team labels Mar 11, 2025
@soryboums
Copy link

This was present in the core mixin but has been removed there in v19 57d9a2f.

I do agree about the lack of documenting this in the release note

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This issue is related to documentation P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

3 participants