Skip to content

Toast notification: multiple positions at the same time? #41

@SHxKM

Description

@SHxKM

Hi,

First I want to say that the toast notification component is amazing. Just verifying that it isn't quite possible to render two toasts at two different positions?

I copied this to my .js file:

window.toast = function (message, options = {}) {
    let description = '';
    let type = 'default';
    let position = 'top-center';
    let html = '';
    if (typeof options.description != 'undefined') description = options.description;
    if (typeof options.type != 'undefined') type = options.type;
    if (typeof options.position != 'undefined') position = options.position;
    if (typeof options.html != 'undefined') html = options.html;

    window.dispatchEvent(new CustomEvent('toast-show', {
        detail: {
            type: type,
            message: message,
            description: description,
            position: position,
            html: html
        }
    }));
}

And I invoke two toasts one after the other:

x-init="toast('some message', {'position': 'bottom-right', 'type': 'success'})"
....Later:
toast('Copied to clipboard')

When the 2nd toast is invoked, both toasts are now positioned top-center.

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