Buttons position swapped from original sweetalert...!?
See original GitHub issueMy users (reasonably) complained that when I made this switch, the buttons switched sides, with Confirm now on the left instead of on the right.
Beyond believing that confirm-on-the-right is superior, I also think that in terms of making it as easy as possible to switch from swal to swal2, youāll want to minimize stuff like this, or at least give an option for easily enabling the old behavior.
I have currently fixed this by using:
.swal2-modal {
direction: rtl;
}
.swal2-modal * {
direction: ltr;
}
Which feels a little silly but itās the simplest way to un-surprise my users.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:9 (2 by maintainers)
Top Results From Across the Web
(JSFIDDLE included) sweet alert js - button swap (the confirm ...
You are using a very old version of sweetalert (0.4.2). It is impossible to reverse the buttons in that version unless you "hack"...
Read more >SweetAlert2 - a beautiful, responsive, customizable and ...
A beautiful, responsive, customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes.
Read more >How to create customized multilingual SweetAlert2 messages
Because there is no ācancelā button in āthank youā message, I made a background color for each div to be changed before popping...
Read more >How to Change the Position of AlertDialog in Android?
The main layout of the application contains one button which is used to build show the alert dialog at the specified position.
Read more >Docs - SweetAlert
Description: The confirm button that's shown by default. You can change its text by setting button to a string, or you can tweak...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello @malcolmocean and thanks for the nice formatted issue!
I believe youāre looking for the
reverseButtons
option which is documented. Set it totrue
to get a confirm button on the right side.š¢ Based on documentation :
You can use
reverseButtons
default isfalse
but you can set it toĀtrue
Ā if you want to invert default buttons positions (āConfirmā-button on the right side).