Skip to content

bug(cdk): cdk-visually-hidden CSS utility can affect presence/absence of parent container scrollbar on Chrome/Edge #24597

Closed

Description

@vitale232

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

No response

Description

Per the Angular Material Icon Guide, "Indicator" icons should include a span.cdk-visually-hidden element as a sibling to the mat-icon to ensure the indication is communicated via screen readers.

When using this technique within an Angular Material Table, it's having an effect on the browser's scroll behavior. In my replication, you'll see that the CSS is styled to fill the vertical viewport with the "page component". Within the page, there is a fixed-height table that has enough rows to necessitate a scroll bar.

Given the above layout, when the span.cdk-visually-hidden is included in a td, an extra scrollbar is added to the page. In my testing, I've only observed this behavior on Chrome (98.0.4758.102 ) and Edge (99.0.1150.39). Firefox (98.0.1) does not exhibit this behavior.

Reproduction

Steps to reproduce:

  1. In a Chromium-based browser, open this Stackblitz, which was forked from the Material docs
  2. Toggle the flag that adds/removes the span.cdk-visually-hidden, and an extra scrollbar will be added/removed from the app

Expected Behavior

I would expect that the CDK's cdk-visually-hidden CSS class does not affect the scroll structure of the page. I would also expect the behavior of the CSS utility to be the same across browsers.

Actual Behavior

On Chromium Based browsers, the cdk-visually-hidden CSS utility can affect scroll behavior. On Firefox, the CSS class does not affect scroll behavior, and the inconsistent behavior can be confusing. I do not have access to Safari to test the behavior there.

Environment

  • Angular: ~13.0.0
  • CDK/Material: ~13.0.0
  • Browser(s): Chrome 98, Edge 99
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows and Ubuntu

Activity

  1. added
    needs triage
    on Mar 15, 2022
  2. added
    P3
    and removed
    needs triage
    on Mar 16, 2022
  3. self-assigned this
    on Mar 18, 2022
  4. added 2 commits that reference this issue on Mar 18, 2022
    b6623c3
    5b1699f
  5. added 2 commits that reference this issue on Mar 31, 2022
    d8e860f
    82e5af6
  6. added 2 commits that reference this issue on Apr 1, 2022
    38946e6
    949e3c7
  7. added a commit that references this issue on Apr 3, 2022
    5bf02c0
  8. angular-automatic-lock-bot commented on May 2, 2022

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  9. locked and limited conversation to collaborators on May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3area: cdk/a11y

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions