{"action":"created","issue":{"url":"https://api.github.com/repos/sweetalert2/sweetalert2/issues/1210","repository_url":"https://api.github.com/repos/sweetalert2/sweetalert2","labels_url":"https://api.github.com/repos/sweetalert2/sweetalert2/issues/1210/labels{/name}","comments_url":"https://api.github.com/repos/sweetalert2/sweetalert2/issues/1210/comments","events_url":"https://api.github.com/repos/sweetalert2/sweetalert2/issues/1210/events","html_url":"https://github.com/sweetalert2/sweetalert2/issues/1210","id":356887777,"node_id":"MDU6SXNzdWUzNTY4ODc3Nzc=","number":1210,"title":"preConfirm have a problem with custom method","user":{"login":"lowfiend","id":9345164,"node_id":"MDQ6VXNlcjkzNDUxNjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/9345164?v=4","gravatar_id":"","url":"https://api.github.com/users/lowfiend","html_url":"https://github.com/lowfiend","followers_url":"https://api.github.com/users/lowfiend/followers","following_url":"https://api.github.com/users/lowfiend/following{/other_user}","gists_url":"https://api.github.com/users/lowfiend/gists{/gist_id}","starred_url":"https://api.github.com/users/lowfiend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lowfiend/subscriptions","organizations_url":"https://api.github.com/users/lowfiend/orgs","repos_url":"https://api.github.com/users/lowfiend/repos","events_url":"https://api.github.com/users/lowfiend/events{/privacy}","received_events_url":"https://api.github.com/users/lowfiend/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-04T16:31:14Z","updated_at":"2018-11-05T15:16:08Z","closed_at":null,"author_association":"NONE","body":"How to use preConfirm with the following code: \r\n\r\n```\r\nswal({\r\n  showCancelButton: true,\r\n  preConfirm: () => confirm('Are you sure?')\r\n}).then(\r\n  result => {\r\n    if (result.value) {\r\n      swal.close();\r\n    } else {\r\n      swal.??  // not close  because if swal is a input alert, user want to key data again. but I don't see similar method can use\r\n    }\r\n  }\r\n);\r\n```"},"comment":{"url":"https://api.github.com/repos/sweetalert2/sweetalert2/issues/comments/435911482","html_url":"https://github.com/sweetalert2/sweetalert2/issues/1210#issuecomment-435911482","issue_url":"https://api.github.com/repos/sweetalert2/sweetalert2/issues/1210","id":435911482,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNTkxMTQ4Mg==","user":{"login":"gverni","id":17089396,"node_id":"MDQ6VXNlcjE3MDg5Mzk2","avatar_url":"https://avatars2.githubusercontent.com/u/17089396?v=4","gravatar_id":"","url":"https://api.github.com/users/gverni","html_url":"https://github.com/gverni","followers_url":"https://api.github.com/users/gverni/followers","following_url":"https://api.github.com/users/gverni/following{/other_user}","gists_url":"https://api.github.com/users/gverni/gists{/gist_id}","starred_url":"https://api.github.com/users/gverni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gverni/subscriptions","organizations_url":"https://api.github.com/users/gverni/orgs","repos_url":"https://api.github.com/users/gverni/repos","events_url":"https://api.github.com/users/gverni/events{/privacy}","received_events_url":"https://api.github.com/users/gverni/received_events","type":"User","site_admin":false},"created_at":"2018-11-05T15:16:08Z","updated_at":"2018-11-05T15:16:08Z","author_association":"COLLABORATOR","body":"Hi @lowfiend, if I understood your question, you don't have to do anything in the `.then()`. As a matter of fact you should not even call `swal.close()` there. The way `preConfirm` works is that it keep showing the pop-up until the `preConfirm` function returns `true`. \r\n\r\nHere a codepen with your code: https://codepen.io/anon/pen/vQEwPz"}}
{"actor":{"display_login":"gverni"}}