npm sweetalert2 11.0.0
v11.0.0

latest releases: 11.14.0, 11.13.3, 11.13.2...
3 years ago

11.0.0 (2021-05-14)

🔴 Breaking change # 1 - IE11 and Legacy Edge support is DISCONTINUED

If you need to support these old browsers in your project, please use the previous major release v10.16.7


🔴 Breaking change # 2 - .queue(), .getQueueStep(), .insertQueueStep(), .deleteQueueStep() methods are REMOVED

async/await can perfectly replace all use-cases of .queue().


🔴 Breaking change # 3 - deprecated lifecycle hooks are REMOVED

Replace them with new ones:

  • onBeforeOpen -> willOpen
  • onOpen -> didOpen
  • onRender -> didRender
  • onClose -> willClose
  • onAfterClose -> didClose
  • onDestroy -> didDestroy

🔴 Breaking change # 4 - deprecated animation param is REMOVED

Use showClass and hideClass instead:

Swal.fire({
  ...
  showClass: {
    backdrop: 'swal2-noanimation', // disable backdrop animation
    popup: '',                     // disable popup animation
    icon: ''                       // disable icon animation
  },
  hideClass: {
    popup: '',                     // disable popup fade-out animation
  },
})

🔴 Breaking change # 5 - .swal2-header and .swal2-content blocks and related methods .getHeader() and .getContent() are REMOVED

Use these alternatives instead:

  • .getHeader() -> .getTitle()
  • .getContent() -> .getHtmlContainer()

💅 Styling change # 1 - Update buttons color

Before After

💅 Styling change # 2 - Switch to CSS Grid Layout

CSS Grid provides much more possibilities for reordering elements inside a popup.

💅 Styling change # 3 - Refreshed look for toasts

💅 Styling change # 4 - Loaded in toasts moved to the left side (instead of the icon)

CleanShot 2021-05-14 at 14 56 30

Don't miss a new sweetalert2 release

NewReleases is sending notifications on new releases.