javascript - Sweetalert2 allowOutsideClick not working on toast mode and close button not appearing on right side - Stack Overfl

I'm using Sweetalert2 from , this is my configurationswal({title: 'Success!',type: 

I'm using Sweetalert2 from /, this is my configuration

  swal({
      title: 'Success!',
      type: 'success',
      toast: true,
      html: response.message,
      showCloseButton: true,
      showCancelButton: true,
      allowEscapeKey: true,
      allowOutsideClick: true,
      //focusConfirm: false,
      confirmButtonText: 'Continue Shopping',
      confirmButtonAriaLabel: 'Continue Shopping',
      cancelButtonText: '<a href="' + cartLink + '" style="color:white;">View Cart and Checkout</a>',
      cancelButtonColor: '#ff6d02',
      cancelButtonAriaLabel: 'Cart',
  });

This is the result

So, the problem is that the outsideclick true config doesn't work and the close button is not on the right. How can I fix this please?

I'm using Sweetalert2 from https://sweetalert2.github.io/, this is my configuration

  swal({
      title: 'Success!',
      type: 'success',
      toast: true,
      html: response.message,
      showCloseButton: true,
      showCancelButton: true,
      allowEscapeKey: true,
      allowOutsideClick: true,
      //focusConfirm: false,
      confirmButtonText: 'Continue Shopping',
      confirmButtonAriaLabel: 'Continue Shopping',
      cancelButtonText: '<a href="' + cartLink + '" style="color:white;">View Cart and Checkout</a>',
      cancelButtonColor: '#ff6d02',
      cancelButtonAriaLabel: 'Cart',
  });

This is the result

So, the problem is that the outsideclick true config doesn't work and the close button is not on the right. How can I fix this please?

Share Improve this question edited Jun 20, 2020 at 9:12 CommunityBot 11 silver badge asked Jul 26, 2018 at 9:12 degee147degee147 2552 gold badges5 silver badges15 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

I'm the author of SweetAlert2, thanks for posting this question.

1. Close button

close button is not on the right

This is fixed in the latest release (v7.26.4), please update your dependency.

2. allowOutsideClick parameter

The allowOutsideClick parameter isn't patible with toasts, since toasts are modeless and don't have a backdrop. In the latest version you will get the console warning about inpatible with toasts parameters:

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744734868a4590683.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信