AlertifyJS icon indicating copy to clipboard operation
AlertifyJS copied to clipboard

Option to disable or unbind ESC and ENTER key on confirm dialog box

Open slolo2000 opened this issue 5 years ago • 6 comments

Hello,

I would like to know if there is a way to disable or unbind default ENTER and ESC key for validate and cancel "confirm dialog box" without the need to use create my own dialog box with the Dialog Factory?

If not, do you think it would be a good idea to implement an option to do it?

Thanks in advance for your answer and have a nice day.

slolo2000 avatar Oct 01 '19 14:10 slolo2000

Hello,

Is there a specific use case that triggered such need ?

MohammadYounes avatar Oct 01 '19 16:10 MohammadYounes

Suppose you have a confirm dialog box with a choice like : Select between these options : Production (for the first button) Test (for the second one)

I think that ENTER or ESC key don't have sense in this case.

slolo2000 avatar Oct 01 '19 16:10 slolo2000

For a keyboard user, this makes perfect sense. To confirm with Enter/Esc wired, I would just press Enter to confirm or Esc to decline.

However, without them I have to tab to the Ok button then hit Enter to confirm OR tab more to the Cancel button then hit Enter to decline.

MohammadYounes avatar Oct 01 '19 18:10 MohammadYounes

You are right if you think about a dialog box with 2 basics choices like Yes / NO or OK / Cancel. Enter / Esc keys are logic key combination. But when you have to select between Delete / Copy or Move left / Move right or anything that need a real decision that cannot be answered by a simple Yes / OK or No / Cancel I think it makes sense to force the user to select the right answer by selecting the correct button to avoid mistakes.

Now, has you told me in a previous post, this is not the basic philosophy of this component. But it could be a nice addition like for the examples I have mentioned just above.

slolo2000 avatar Oct 02 '19 07:10 slolo2000

Hi,

Is there any chance to have this behavior in AlertifyJS in a future release?

Component like SweetAlert2 do it but I really want to keep AlertifyJS because I use it from years and I simply love it.

image

Please, let me know if you think that it should be hard or not to add this feature.

Thanks and have a nice day.

slolo2000 avatar Jun 01 '23 07:06 slolo2000

Very need this feature

CSGrandeur avatar Sep 05 '23 12:09 CSGrandeur