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.
Built from https://develop.svn.wordpress.org/trunk@51945


git-svn-id: http://core.svn.wordpress.org/trunk@51534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
joedolson 2021-10-28 16:07:59 +00:00
parent a5926f8ece
commit acabcf82ff
3 changed files with 4 additions and 4 deletions

View File

@ -8071,8 +8071,8 @@ Modal = wp.media.View.extend(/** @lends wp.media.view.Modal.prototype */{
// Enable page scrolling. // Enable page scrolling.
$( 'body' ).removeClass( 'modal-open' ); $( 'body' ).removeClass( 'modal-open' );
// Hide modal and remove restricted media modal tab focus once it's closed. // Hide the modal element by adding display none.
this.$el.hide().off( 'keydown' ); this.$el.hide();
/* /*
* Make visible again to assistive technologies all body children that * Make visible again to assistive technologies all body children that

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.9-alpha-51944'; $wp_version = '5.9-alpha-51945';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.