question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Buttons position swapped from original sweetalert...!?

See original GitHub issue

My 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:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

24reactions
limontecommented, Feb 3, 2017

Hello @malcolmocean and thanks for the nice formatted issue!

I believe you’re looking for the reverseButtons option which is documented. Set it to true to get a confirm button on the right side.

5reactions
MrSenhajicommented, Nov 21, 2019

šŸ”¢ Based on documentation :

You can use reverseButtons default is false but you can set it toĀ trueĀ if you want to invert default buttons positions (ā€œConfirmā€-button on the right side).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found