t4t5 / sweetalert

A beautiful replacement for JavaScript's "alert"
https://sweetalert.js.org
MIT License
22.4k stars 2.84k forks source link

.then((result) => break IE and out of date ipad using safari #818

Open Mammouth1979 opened 6 years ago

Mammouth1979 commented 6 years ago

=> { is not supported by IE and out of date safari. It block entire page to display.

In sample code

.then((result) => {

should be replaced by

.then(function(result){

legendarylion commented 6 years ago

So. Much. This. I've spent hours attempting to find a solution for this. Thank you for figuring it out!

lionralfs commented 6 years ago

We discussed changing the documentation to a IE11 friendly version here. I can tell that there has been quite a lot of confusion about the usage of arrow function in the documentation (probably due to the fact of people just copy/pasting examples into their projects without transpiling). I would recommend adding a warning next to the examples that use arrow functions indicating that you would need to change () => { } to function () { } in case you need to support browsers that don't support arrow functions. What are your thoughts @t4t5?

sanket-jayani commented 6 years ago

Thank you so much after spending a lot time finally its works for me!!

Simone-cogno commented 3 years ago

did somebody found a solution to this? This actually make my whole application to broke on IE11. I'm using babel transpiler but for some reason there are still some arrow function on the final code if I include "sweatalert".