Responsive Modal don't close on ESC

Responsive Modal don't close on ESC

joseoliveiraborlasjoseoliveiraborlas Posts: 80Questions: 8Answers: 3

In responsive plugin, when using modal to show all info, the ESC don't work to close the modal. Have to use external script. This is the line (1262):

$(document).on( 'keyup.dtr', function (e) {
    if ( e.keyCode === 27 ) {
        e.stopPropagation();
        close();
    }
} );

Replies

  • joseoliveiraborlasjoseoliveiraborlas Posts: 80Questions: 8Answers: 3
    edited March 2023

    Soluction:

    $(document).on('keyup', function(e) {
        if (e.keyCode === 27) {
            e.stopPropagation();
            $('.modal').modal('hide');
        }
    });
    
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    Thanks for posting back. That looks like a fix for a Bootstrap modal. Looks good.

    Allan

Sign In or Register to comment.