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
This commit is contained in:
Joe Dolson
2021-10-28 16:06:20 +00:00
parent 39479eb86a
commit 548829f271

View File

@@ -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