From 548829f2717de01fea971c740380e89a80fe7543 Mon Sep 17 00:00:00 2001 From: Joe Dolson Date: Thu, 28 Oct 2021 16:06:20 +0000 Subject: [PATCH] Media: Close attachment details modal with esc key. The event that fired closing the attachment details modal also removed the keydown event listener, so subsequent modals could not be closed with the escape key. Props vondelphia, sourovroy, sabernhardt Fixes #53924. git-svn-id: https://develop.svn.wordpress.org/trunk@51945 602fd350-edb4-49c9-b593-d223f7449a82 --- src/js/media/views/modal.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/media/views/modal.js b/src/js/media/views/modal.js index 42fc7c9f60..f28c92e7e6 100644 --- a/src/js/media/views/modal.js +++ b/src/js/media/views/modal.js @@ -138,8 +138,8 @@ Modal = wp.media.View.extend(/** @lends wp.media.view.Modal.prototype */{ // Enable page scrolling. $( 'body' ).removeClass( 'modal-open' ); - // Hide modal and remove restricted media modal tab focus once it's closed. - this.$el.hide().off( 'keydown' ); + // Hide the modal element by adding display none. + this.$el.hide(); /* * Make visible again to assistive technologies all body children that