Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
slolo2000 opened this issue Oct 1, 2019 · 6 comments
Open

Comments

@slolo2000
Copy link

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.

@MohammadYounes
Copy link
Owner

Hello,

Is there a specific use case that triggered such need ?

@slolo2000
Copy link
Author

slolo2000 commented Oct 1, 2019

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.

@MohammadYounes
Copy link
Owner

MohammadYounes commented Oct 1, 2019

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.

@slolo2000
Copy link
Author

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
Copy link
Author

slolo2000 commented Jun 1, 2023

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.

@CSGrandeur
Copy link

Very need this feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants