Add option to have cancel be default action
See original GitHub issueCurrently setting reverseButtons: true
does not reverse the behaviour of the space/enter key to click “cancel” instead of “confirm”. This means that pressing enter still uses the “confirm” button.
It would be nice to reverse this behaviour when reversing the button positions, so defensive behaviour can be the default in that case.
It looks like this behaviour primarily lives here: https://github.com/limonte/sweetalert2/blob/master/src/sweetalert2.js#L522-L523
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
What to call "Cancel" when "Cancel" is already the default ...
My suggestion: never use the word "Cancel" in the default action. To cancel a subscription, you can, for example, say "Remove Subscription" ...
Read more >how can i cancel the default action if user set my action as ...
1 Answer 1 ... Easy. Go to Settings -> Applications -> Manage Applications. Find the app that was set to default (For example,...
Read more >What term to use for “Cancel” when “Cancel” is already the ...
If the default is “cancel,” the cancel button should be called something straightforward, such as “Don't cancel.” It is to be noted that...
Read more >Browser default actions - The Modern JavaScript Tutorial
The main way is to use the event object. There's a method event.preventDefault() . If the handler is assigned using on<event> (not by ......
Read more >Default Actions - Salesforce Help
Default actions are sets of predefined actions to get you and your users started using actions in your org. Add default actions to...
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
I too feel that we lack a way to change default behavior. It can be useful to have cancel be the default.
We should consider whether this should be bound to button order, though - people might want the default to be on the left/right depending on the rest of their system, so we might want to add it as another option.
@limonte would it be an acceptable option to add a new parameter for reversing/changing default focused button?