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

Cancel button to act like a skip button to next swal dialog in a .mixin() queue #1294

Closed
Xerotherm1c opened this issue Nov 14, 2018 · 1 comment

Comments

@Xerotherm1c
Copy link

Xerotherm1c commented Nov 14, 2018

New feature motivation

I have a 3-question swal.mixin() queue, tweaked from the example in the documentation. I've set the cancelButtonText value to "Skip" but I haven't been able to find a way to suppress the actual closing of the dialog when the cancel button is pressed. I was playing with an aysnc example that allows you to go backward and forward, but it would be very nice to have a way to suppress the close action and run a function instead.

I've found answers that say to use altActionButton but it doesn't appear to be in sweetalert2 anymore. Likewise, buttons appears to be phased out from v1.

Also, it would be nice if we could run something like swal.goToInQueue(positionIndex) from within this function where the dialog close action has been suppressed.

Thanks for a great plugin! Cheers!

@limonte
Copy link
Member

limonte commented Nov 21, 2018

I don't think it's worthy to add any additional complexity to the existed functionality.

async/await provide flexibility in achieving any kind of custom queueing functionality:

Live demo: https://nice-belt.glitch.me/
Source: https://glitch.com/edit/#!/nice-belt

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