From 0ccd68f23928e52a097ce7663f1b91b6b8a42b92 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sun, 24 Aug 2014 16:54:35 +0000 Subject: [PATCH] Media Grid: Don't make checkboxes tabbable when in bulk select media grid mode, fixes tabbing in bulk select mode. Props adamsilverstein. See #28822. git-svn-id: https://develop.svn.wordpress.org/trunk@29585 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/media-views.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/js/media-views.js b/src/wp-includes/js/media-views.js index 19bfd32d59..fa8a7c7fef 100644 --- a/src/wp-includes/js/media-views.js +++ b/src/wp-includes/js/media-views.js @@ -4942,7 +4942,8 @@ * @param {Backbone.Collection} collection */ select: function( model, collection ) { - var selection = this.options.selection; + var selection = this.options.selection, + controller = this.controller; // Check if a selection exists and if it's the collection provided. // If they're not the same collection, bail; we're in another @@ -4956,9 +4957,12 @@ return; } - // Add 'selected' class to model, set aria-checked to true and make the checkbox tabable. - this.$el.addClass( 'selected' ).attr( 'aria-checked', true ) - .find( '.check' ).attr( 'tabindex', '0' ); + // Add 'selected' class to model, set aria-checked to true. + this.$el.addClass( 'selected' ).attr( 'aria-checked', true ); + // Make the checkbox tabable, except in media grid (bulk select mode). + if ( ! ( controller.isModeActive( 'grid' ) && controller.isModeActive( 'select' ) ) ) { + this.$( '.check' ).attr( 'tabindex', '0' ); + } }, /** * @param {Backbone.Model} model