r/javascript • u/limonmonte • Nov 13 '19
SweetAlert2 - a beautiful, responsive, highly customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes (alert, prompt, dialog, toast, side panel, etc.)
https://sweetalert2.github.io/18
u/sdiown Nov 14 '19
You changed the fire action 1000 times, what the heck. In every release you are changing the name of firing function and it's parameters. Not good...
1
u/Aswole Nov 14 '19
I think it's ok if the changes are made across major versions, but if they are changing the API incrementally... Yikes
2
u/limonmonte Nov 14 '19
We are strictly following the semver and breaking changes are present only in major releases. Also, we are mostly deprecating API params and methods before removing/changing them and notifying users about deprecations.
4
u/imbk_dev Nov 13 '19
I love it, it looks awesome.
One problem I had on my phone (latest chrome, android) is that the page is not responsive for a second or two after the pop-up closes. Please check that out.
3
u/limonmonte Nov 14 '19
That's the bug in the current (78) and next (79) versions of Chrome on Android. They fixed it in 80, you can install Chrome Dev and verify that all is working smoothly there.
Funny enough all is well in all other desktop and mobile browsers including Brave on Android which is also Chromium-based browser, so I suspect that Google devs made some rendering "optimization" which causes this issue.
2
2
u/tbranyen Nov 14 '19
Looks really nice, will have to dig into the config to see if you can disable the scrollbar hiding. I don't like seeing my page shift every time I click.
This was developed using a Mac I bet.
2
u/limonmonte Nov 14 '19
> Looks really nice, will have to dig into the config to see if you can disable the scrollbar hiding. I don't like seeing my page shift every time I click.
The page shouldn't shift as we're measuring the scrollbar and adding the body padding when a modal is shown. Could you provide more details about the issue you're facing? https://github.com/sweetalert2/sweetalert2/issues
Thanks in advance!
12
Nov 14 '19
This is amazing work, thank you. I’ve always avoided modals because they are sort of a pain in the ass to implement, and no pre-rolled solution has really hit all the marks for me. But these are just... delightful. I want to use them excessively.
6
4
u/barelylogic Nov 13 '19
Looks great! And really good examples showing various uses. One to remember for my future projects. Thanks for sharing!
3
u/massenburger Nov 14 '19
We use this library day in and day out where I work, and we absolutely love it. They have a configurable option for just about anything you can think of. The only downside is that the customized themes breaks the regular import statement. The standard import still wants to import the default style, so we had to grab the bundled version from the dist/ folder directly. Other than that, it's been great!
2
2
2
2
2
2
u/sammyb0ye Nov 14 '19
Been introduced to swal recently and already migrated 3 projects, I really dig it. Thank you for the work you put in it!
1
u/rabakilgur Nov 14 '19
When using the demo “A confirm dialog, with a function attached to the "Confirm"-button...” the windows flashes for a slit second when the first modal disasters and the second one appears. IMO that’s a real deal breaker.
But other than that it looks great. Nice work!
1
28
u/limonmonte Nov 13 '19
Many of you already know about SweetAlert2, I'm sharing it again here because we recently shipped the new major release v9.0.0 with better customization (new showClass and hideClass params, progress bar for timer) and themes:
Dark
Bootstrap 4
Material UI
Minimal
Borderless
All themes can be viewed here: https://sweetalert2.github.io/ (the theme switcher is in the left sidebar)
See the release notes for all changes: https://github.com/sweetalert2/sweetalert2/releases/tag/v9.0.0
Read more about SweetAlert2 themes: https://github.com/sweetalert2/sweetalert2-themes