jquery-confirm icon indicating copy to clipboard operation
jquery-confirm copied to clipboard

Pressing ESC, Enter or any other keys does not work.

Open bigallew opened this issue 7 years ago • 1 comments

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.

bigallew avatar Mar 14 '18 07:03 bigallew

Did anyone manage to fix this issue?

tirolel avatar Jun 18 '19 07:06 tirolel