Skip to content

Exclude aria-live that are direct descendants of body from aria-hidden while modal is open #4851

@PhilippMDoerner

Description

@PhilippMDoerner

I use both CDK and NG-Bootstrap in my side-project.
While I was building a modal within which an interaction happens for which I wanted to use CDK-LiveAnnouncer I noticed an interesting interaction:

Ng-Bootstrap, when opening a modal, appears to be applying aria-hidden="true" to ever direct child of the body-tag as long as it's not a script-tag. This includes the aria-live region that i.e. cdk-live-announcer uses to announce its code.

This of course makes it effectively impossible to announce anything with LiveAnnouncer while an Ng-Bootstrap modal is open.

I would therefore propose that when fetching all elements to apply aria-hidden to when a modal opens, that elements that contain the aria-live attribute should be excluded from that step.

Minimal reproduction to demonstrate the issue: https://stackblitz.com/edit/stackblitz-starters-dpmg6qns?file=src%2Fdialog.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions