Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple swal #974

Open
jdechaseaux opened this issue Oct 8, 2021 · 2 comments
Open

Multiple swal #974

jdechaseaux opened this issue Oct 8, 2021 · 2 comments

Comments

@jdechaseaux
Copy link

Hello everebody, I have issues trying to display multiple swal.

Only the last swal is displayed. I tried many things with sweetalert and sweetalert2, without success. I tried use swal.queue but i have error like swal.queue doesnt exist.

Because i have situation where condition1 and condition2 are true or other situations ... And in fact i have more than 3 swal, but this is for the example.

Here is my code :

            if (condition1true) {
            swal({
                    title: "Erreur",
                    content: htmlContent,
                    icon: "error",
                    dangerMode: true,
                    className: "swalError"
                })
            }
        if (condition2true) {
            swal({
                    title: "Succes",
                    text: "text here...",
                    icon: "success"
                })
        }
        if (condition3true) {
                        swal({
                    title: "Succes",
                    text: "text here...",
                    icon: "success"
                })

        }

Thanks for your help

@jm-taotao
Copy link

but my project onley see the first, the next away flash across

@lionralfs
Copy link
Collaborator

You can do something like this: https://codepen.io/lionralfs/pen/mdqXWGX?editors=0010 which makes use of await to wait until a swal is closed, see docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants