Skip to content

feat(COMPONENT): allow multiple instances of AriaDescriber #23499

Closed
@yann-armelin-1a

Description

@yann-armelin-1a

Feature Description

Allow to have several AriaDescriber containers on a same page.
Today the container of AriaDescriber is necessarily appended to body, with an hardcoded id, and any pre-existing container is removed.

I see At least 3 different options to achieve this:

  1. Do something similar to what's done in LiveAnnouncer: use an Injection token to inject the container.

  2. Make the following constant customizable: MESSAGES_CONTAINER_ID . So that each instance of AriaDescriber can have his own container.

  3. Do something similar to OverlayContainer so that the container can be moved somewhere else on the page, and stop relying on the ID the remove it

In all cases, the following const should be customizable: CDK_DESCRIBEDBY_ID_PREFIX, otherwise elements with duplicated ID will be created on the page.

Use Case

In the context of micro frontends, we may end up with 2 Angular Material instances on the same page.

Today, a second instance of AriaDescriber would remove the container of the first one, making it ineffective.

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/a11yfeatureThis issue represents a new feature or feature request rather than a bug or bug fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions