Make WordPress Core

Ticket #53924: 53924.diff

File 53924.diff, 533 bytes (added by sourovroy, 3 years ago)

This patch can fix the issue of close modal by Escape key.

  • src/js/media/views/modal.js

    diff --git a/src/js/media/views/modal.js b/src/js/media/views/modal.js
    index 42fc7c9f60..9f4aa21ee6 100644
    a b Modal = wp.media.View.extend(/** @lends wp.media.view.Modal.prototype */{ 
    139139                $( 'body' ).removeClass( 'modal-open' );
    140140
    141141                // Hide modal and remove restricted media modal tab focus once it's closed.
    142                 this.$el.hide().off( 'keydown' );
     142                this.$el.hide();
    143143
    144144                /*
    145145                 * Make visible again to assistive technologies all body children that