question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SweetAlertOptions.progressSteps inconsistent type definition

See original GitHub issue

The type definition of the progressSteps field inside of the SweetAlertOptions class specifies an array of SweetAlertOptions, however the example shows it being used as an array of strings.

The setProgressSteps method also takes an array of strings, therefore I think the progressSteps field inside of the SweetAlertOptions class should be updated to expect an array of strings.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
limontecommented, Jul 16, 2017

Thanks a lot @michaelbull for reporting and fixing this! 🍻

1reaction
michaelbullcommented, Jul 15, 2017

If I pass the array of SweetAlertOptions to the progressSteps field when calling swal.setDefaults (example below), then this happens (note the step numbers are replaced with [object Object]).

        let steps: SweetAlertOptions[] = [
            {
                title: 'Question 1',
                text: 'Chaining swal2 modals is easy'
            },
            {
                title: 'Question 2',
                text: 'q2'
            },
            {
                title: 'Question 3',
                text: 'q3'
            }
        ];

        swal.setDefaults({
            input: 'text',
            confirmButtonText: 'Next →',
            showCancelButton: true,
            animation: false,
            progressSteps: steps
        });
Read more comments on GitHub >

github_iconTop Results From Across the Web

facing some issue to set type on sweetalert2 - Stack Overflow
Argument of type '{ animation: boolean; title: string; }' is not assignable to parameter of type 'SweetAlertOptions<any, any>'.
Read more >
sweetalert2/sweetalert2.d.ts at main - GitHub
Normalizes the arguments you can give to Swal.fire() in an object of type SweetAlertOptions. *. * Example: * ```. * Swal.argsToParams(['title', 'text']) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found