Skip to content

Commit b0cfcbb

Browse files
Media Grid: Fix escape key sometimes failing to close details modal.
Fix an issue where the escape key would no longer close the attachment details modal after attempting to navigate over the navigation boundaries (by clicking the left arrow key on the first media item or clicking the right arrow key on the last media item). Remove a focus blur which caused the underlying Backbone View to not receive the 'keydown' event. Props subrataemfluence, afercia. Fixes #42180. git-svn-id: https://develop.svn.wordpress.org/trunk@41856 602fd350-edb4-49c9-b593-d223f7449a82
1 parent faeac43 commit b0cfcbb

2 files changed

Lines changed: 0 additions & 4 deletions

File tree

src/wp-includes/js/media-grid.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,6 @@ EditAttachments = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.EditAtta
795795
*/
796796
previousMediaItem: function() {
797797
if ( ! this.hasPrevious() ) {
798-
this.$( '.left' ).blur();
799798
return;
800799
}
801800
this.trigger( 'refresh', this.library.at( this.getCurrentIndex() - 1 ) );
@@ -807,7 +806,6 @@ EditAttachments = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.EditAtta
807806
*/
808807
nextMediaItem: function() {
809808
if ( ! this.hasNext() ) {
810-
this.$( '.right' ).blur();
811809
return;
812810
}
813811
this.trigger( 'refresh', this.library.at( this.getCurrentIndex() + 1 ) );

src/wp-includes/js/media/views/frame/edit-attachments.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ EditAttachments = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.EditAtta
201201
*/
202202
previousMediaItem: function() {
203203
if ( ! this.hasPrevious() ) {
204-
this.$( '.left' ).blur();
205204
return;
206205
}
207206
this.trigger( 'refresh', this.library.at( this.getCurrentIndex() - 1 ) );
@@ -213,7 +212,6 @@ EditAttachments = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.EditAtta
213212
*/
214213
nextMediaItem: function() {
215214
if ( ! this.hasNext() ) {
216-
this.$( '.right' ).blur();
217215
return;
218216
}
219217
this.trigger( 'refresh', this.library.at( this.getCurrentIndex() + 1 ) );

0 commit comments

Comments
 (0)