Skip to content

Make the toast.close function externally accessible #73

@gabos-levente

Description

@gabos-levente

The toast component allows us to include not only plain text in the description but also custom components when needed. This flexibility is invaluable in our application, as it enables us to provide users with actionable buttons alongside notifications. The application we are developing involves asynchronous processes that can run for several hours. In such cases, users typically do not wait for the process to complete but instead start new ones. Events related to these processes often arrive as toast notifications with significant delays—sometimes hours after initiation.

In these scenarios, it's extremely helpful if a toast includes a button that allows the user to navigate directly to the relevant process upon receiving a notification.

The issue arises when a user clicks an action button placed inside the toast description. Currently, we cannot programmatically call the toast.close method, requiring the user to click the 'x' icon manually to dismiss the toast.

Would it be possible for the toast function to return a reference to the created toast component or at least provide access to its close method?

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