jquery-confirm
jquery-confirm copied to clipboard
Pressing ESC, Enter or any other keys does not work.
jquery-confirm version: v3.x.x
I'm submitting a ... (check one with "x") [X ] bug report [ ] feature request [ ] support request
Current behavior:
Keyboard keys are not working with my code. I am not sure if it is somehow related to bootstrap modal.
Expected behavior:
Pressing ESC, Enter or Space should dismiss the alert or confirm window.
Steps to reproduce:
Related code:
$("#CommentBtn").click(function () {
if ($("#Comments").val() != "") {
UpdateFindings(1);
}
else {
invalidAlert("Please enter your comments.");
}
})
function invalidAlert(invalidMessage) {
$.confirm({
title: "Validation",
icon: "fa fa-times-circle",
type: "red",
content: invalidMessage,
escapeKey: true,
backgroundDismiss: false,
theme: "bootstrap",
buttons: {
ok: {
btnClass: "btn-blue",
keys: ["enter", "esc", "space"],
action: function () {
}
},
no: {
keys: ['N'],
action: function () {
$.alert('You clicked No.');
}
},
}
});
}
Other information: Used both $.alert and $.confirm to check this.
Did anyone manage to fix this issue?