-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Description
as pointed out by @abelgomez the $.confirm
instances don't dismiss on escape key or submit on enter,
note to self;
fix escape key each confirm should look like $.confirm({backgroundDismiss: true, ...})
fix enter key
Slightly more involved, will have to wrap content
in a <form>
and then add event listener to onContentReady
$.confirm({
...
content: `<form>
...
</form>`
...
buttons: {
doSomething: {
...
keys: ['enter'],
...
}
},
onContentReady: function () {
// bind to events
var jc = this;
this.$content.find('form').on('submit', function (e) {
// if the user submits the form by pressing enter in the field.
e.preventDefault();
jc.$$BUTTON NAME HERE.trigger('click'); // reference the button and click it
});
}
});