Sweetalert: cancel default option

Created on 26 Jul 2015  路  5Comments  路  Source: t4t5/sweetalert

enabled the possibility of putting cancel default when confirmation is requested. If a user presses the Enter key in the confirmation accidental deletion ( example) , the better to cancel not confirm .

Most helpful comment

I'll third this. A "cancelButtonDefault: true" would be a nice option. Not all operations are undoable. It's hard to undo a email notification, for example.

All 5 comments

I second this. Maybe this is already possible right now with some hacking/callbacks?

Actually, the better is to allow for undo of deletion.

In general though, if you click a button to delete something, then a dialog asks for confirmation, pressing ENTER to affirm the action is common practice.

To cancel, you would expect to press ESC.

If the user accidentally does the opposite, this is what we call, "user error".

I'll third this. A "cancelButtonDefault: true" would be a nice option. Not all operations are undoable. It's hard to undo a email notification, for example.

This is now possible in SweetAlert 2.0 using dangerMode: true

That escalated quickly 馃槅

Thanks a lot for adding this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jamieson99 picture jamieson99  路  3Comments

voodoo6 picture voodoo6  路  4Comments

VoxelNaut picture VoxelNaut  路  6Comments

krishnamraju picture krishnamraju  路  3Comments

sastrahost picture sastrahost  路  5Comments