🔴 Breaking change # 1 - rename type
to icon
Swal.fire({
- type: 'success'
+ icon: 'success'
...
})
🔴 Breaking change # 2 - Deprecated API params were removed:
customContainerClass
confirmButtonClass
cancelButtonClass
imageClass
inputClass
Use customClass
instead: https://sweetalert2.github.io#custom-class
🔴 Breaking change # 3 - Deprecated API methods were removed:
disableConfirmButton()
(useSwal.getConfirmButton().setAttribute('disabled', '')
instead)enableConfirmButton()
(useSwal.getConfirmButton().removeAttribute('disabled')
instead)setProgressSteps()
(useSwal.update({ progressSteps: ... })
instead)showProgressSteps()
(useSwal.getProgressSteps()
instead)hideProgressSteps()
(useSwal.getProgressSteps()
instead)
🔴 Breaking change # 4
Cancel buttons isn't getting disabled automatically when showing loader (Swal.showLoader()
)
🎉 NEW FEATURES
🎉 showClass
and hideClass
Now, it's possible to change showing/hiding animations of popups:
Swal.fire({
...
showClass: {
popup: '...',
backdrop: '...',
icon: '...',
},
hideClass: {
popup: '...',
backdrop: '...',
icon: '...',
},
...
})
The animation
param was deprecated, use showClass: { popup: '', icon: '', backdrop: '' }
instead.
🎉 iconHtml
Use any HTML inside icons (e.g. Font Awesome)
Swal.fire({
...
icon: 'success'
iconHtml: '<i class="far fa-thumbs-up"></i>'
...
})
The .swal2-arabic-question-mark
class was removed, use iconHtml: '؟'
instead.