Skip to content

[Toast] Allow to specify container for ToastAnnounce #3661

@ITsvetkoFF

Description

@ITsvetkoFF

Feature request

Overview

The idea is super simple.
By default Toast component collects everything to be pronounced in ToastAnnounce, which uses Portal, which is by default appended to body. Here is the particular line of code
But there are cases when it is useful to append that announcer to some custom container. For instance - when the Toast is called from Modal Dialog that uses FocusTrap.js - FocusTrap automagically makes everything except itself inert, and Toast is not announced - having some defined container for toast announcer will allow to add it to the excluded components for FocusTrap and it won't be inert

This may also happen when toast is called from Radix modal, have not checked though. To be fair for me even in official docs Toast is not pronounced in VoiceOver.

Who does this impact? Who is this for?

This is for advanced cases. looks like requires adding something like announcerContainer to the radix root.

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