Skip to content

Multiple toasts with different positions take first position #438

Open
@kurtcarpenter

Description

@kurtcarpenter

Create a toast. While the first toast is visible, create a second toast with a different position- the second toast will be placed with the first, ignoring its own setting.

e.g.

toastr.success('foo', 'qaz', { positionClass: 'toast-top-right', timeOut: -1 })
toastr.success('bar', 'baz', { positionClass: 'toast-bottom-left' })

results in

<div role="alert" aria-live="polite" class="toast-top-right" id="toast-container">
    <div style="display: block;" class="toast toast-success">...</div>
    <div style="display: block;" class="toast toast-success">...</div>
</div>

The library looks for a given container ID, which defaults to "toast-container". While it is possible to set this with an option, e.g. { containerId: "myContainer" }, this is not well-documented behavior. Additionally, it is a major usability concern to force an extra, undocumented option in order to position correctly, i.e. achieve expected behavior.

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