WordPress.org

Make WordPress Core

Ticket #39859: patch.2.diff

File patch.2.diff, 1.3 KB (added by andreiglingeanu, 4 years ago)
  • src/wp-includes/js/media/views/modal.js

    diff --git a/src/wp-includes/js/media/views/modal.js b/src/wp-includes/js/media/views/modal.js
    index f31a59d6d4..a757869bbb 100644
    a b Modal = wp.media.View.extend(/** @lends wp.media.view.Modal.prototype */{ 
    1717        tagName:  'div',
    1818        template: wp.template('media-modal'),
    1919
    20         attributes: {
    21                 tabindex: 0
    22         },
    23 
    2420        events: {
    2521                'click .media-modal-backdrop, .media-modal-close': 'escapeHandler',
    2622                'keydown': 'keydown'
    Modal = wp.media.View.extend(/** @lends wp.media.view.Modal.prototype */{ 
    125121                        }
    126122                }
    127123
    128                 this.$el.focus();
     124                this.$el.find('> .media-modal').focus();
    129125
    130126                return this.propagate('open');
    131127        },
  • src/wp-includes/media-template.php

    diff --git a/src/wp-includes/media-template.php b/src/wp-includes/media-template.php
    index bd0e31f2a0..ccd02d6d06 100644
    a b function wp_print_media_templates() { 
    162162        </script>
    163163
    164164        <script type="text/html" id="tmpl-media-modal">
    165                 <div class="<?php echo $class; ?>">
     165                <div tabindex="0" class="<?php echo $class; ?>">
    166166                        <button type="button" class="media-modal-close"><span class="media-modal-icon"><span class="screen-reader-text"><?php _e( 'Close media panel' ); ?></span></span></button>
    167167                        <div class="media-modal-content"></div>
    168168                </div>