Make WordPress Core

Ticket #47120: 47120.3.diff

File 47120.3.diff, 2.2 KB (added by joedolson, 4 years ago)

Working patch!

  • src/js/media/views/uploader/inline.js

     
    115115
    116116                        $browser.detach().text( $placeholder.text() );
    117117                        $browser[0].className = $placeholder[0].className;
     118                        $browser[0].setAttribute( 'aria-labelledby', $browser[0].id + ' ' + $placeholder[0].getAttribute('aria-labelledby') );
    118119                        $placeholder.replaceWith( $browser.show() );
    119120                }
    120121
  • src/js/media/views/uploader/status.js

     
    116116                        message:  error.get( 'message' )
    117117                } );
    118118
     119                var buttonClose = this.$el.find( 'button' );
     120
    119121                // Can show additional info here while retrying to create image sub-sizes.
    120122                this.views.add( '.upload-errors', statusError, { at: 0 } );
     123                _.defer( function() {
     124                        buttonClose.trigger( 'focus' );
     125                        wp.a11y.speak( error.get( 'message' ), 'assertive' );
     126                });
    121127        },
    122128
    123129        dismiss: function() {
  • src/wp-includes/media-template.php

     
    252252                        <div class="upload-ui">
    253253                                <h2 class="upload-instructions drop-instructions"><?php _e( 'Drop files to upload' ); ?></h2>
    254254                                <p class="upload-instructions drop-instructions"><?php _ex( 'or', 'Uploader: Drop files here - or - Select Files' ); ?></p>
    255                                 <button type="button" class="browser button button-hero"><?php _e( 'Select Files' ); ?></button>
     255                                <button type="button" class="browser button button-hero" aria-labelledby="post-upload-info"><?php _e( 'Select Files' ); ?></button>
    256256                        </div>
    257257
    258258                        <div class="upload-inline-status"></div>
    259259
    260                         <div class="post-upload-ui">
     260                        <div class="post-upload-ui" id="post-upload-info">
    261261                                <?php
    262262                                /** This action is documented in wp-admin/includes/media.php */
    263263                                do_action( 'pre-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores