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

How con I use the Key Enter in the Prompt

Open Raitorick opened this issue 6 years ago • 2 comments

I´m ussing the last version of the Jquery Confirm, but i have a question.

How can i use the key enter but inside the textbox?

I already add this;

keys: [ 'enter' ],

but only works when the textbox isn´t focus. I need that i can submit the prompt when i press Enter Key inside the textbox because, i´m working with a barcode scanner so the enter is press automatically

Thanks.

Raitorick avatar Mar 05 '19 16:03 Raitorick

I have the same issue

phpxtreme avatar Mar 27 '19 19:03 phpxtreme

Workaround:

onOpen: function () {
    let submit = this.$$confirm;
    $(this.$content).on('keypress', function(e) {
        if (e.which === 13) {
            submit.trigger('click');
        }
    });
}

mgralikowski avatar Apr 27 '20 17:04 mgralikowski