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.

Chaining results return undefined

See original GitHub issue

Okay, I’m at a loss here. All the inputs are behaving correctly but my results keep returning undefined. Any thoughts? Using latest SWAL version and jQuery 3.1.0 my code:

 $(".createacctbtn").click(function(){
        swal.setDefaults({
              confirmButtonText: 'Next →',
              reverseButtons: true,
              showCancelButton: true,
              animation: false,
              progressSteps: ['1', '2', '3']
           })

        var steps = [
          {
              text: 'Enter your name',
              input:'text'
          },
            {
                text:'Enter your desired password',
                input: 'password'
            },
            {
                text: 'Enter your email address',
                input: 'email'
            }
        ]

        swal.queue(steps).then(function(result) {
          swal.resetDefaults()
          swal({
            title: 'All done!',
            html:
              'Your answers: <pre>' +
                JSON.stringify(result) +
              '</pre>',
            confirmButtonText: 'Lovely!',
            showCancelButton: false
          })
        }, function() {
          swal.resetDefaults()
        })
});

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
limontecommented, Oct 27, 2016

update swal2 to the latest.

0reactions
KillerSquidcommented, Oct 27, 2016

Just downloaded directly from GitHub and added it to my page via <script src="./js/sweetalert2.min.js" type="text/javascript"></script> then dumped cache and hard reloaded in Chrome. (online app in development)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Optional Chaining in JavaScript returns undefined instead of ...
An optional chain does not evaluate to the nullish value on which the property was accessed, but to undefined - just like you...
Read more >
Optional chaining (?.) - JavaScript - MDN Web Docs - Mozilla
When used with function calls, it returns undefined if the given function does not exist. This results in shorter and simpler expressions when ......
Read more >
How to Use Optional Chaining in JavaScript - freeCodeCamp
The optional chaining operator ?. takes the reference to its left and checks if it is undefined or null. If the reference is...
Read more >
Using and chaining promises in AngularJS - AirPair
Be aware that not explicty returning a value means that you have returned undefined , and the derived promise will be resolved with...
Read more >
Optional chaining (?.) - JavaScript
When used with function calls, it returns undefined if the given function does not exist. This results in shorter and simpler expressions when...
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