diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
index a22aa76..5c0d0a4 100644
|
|
|
77 | 77 | * @param {Function} [params.completeCallback] |
78 | 78 | */ |
79 | 79 | focus = function ( params ) { |
80 | | var construct, completeCallback, focus; |
| 80 | var construct, completeCallback, focus, focusElement; |
81 | 81 | construct = this; |
82 | 82 | params = params || {}; |
83 | 83 | focus = function () { |
… |
… |
|
90 | 90 | focusContainer = construct.container; |
91 | 91 | } |
92 | 92 | |
93 | | // Note that we can't use :focusable due to a jQuery UI issue. See: https://github.com/jquery/jquery-ui/pull/1583 |
94 | | focusContainer.find( 'input, select, textarea, button, object, a[href], [tabindex]' ).filter( ':visible' ).first().focus(); |
| 93 | focusElement = focusContainer.find( '.control-focus:first' ); |
| 94 | if ( 0 === focusElement.length ) { |
| 95 | // Note that we can't use :focusable due to a jQuery UI issue. See: https://github.com/jquery/jquery-ui/pull/1583 |
| 96 | focusElement = focusContainer.find( 'input, select, textarea, button, object, a[href], [tabindex]' ).filter( ':visible' ).first(); |
| 97 | } |
| 98 | focusElement.focus(); |
95 | 99 | }; |
96 | 100 | if ( params.completeCallback ) { |
97 | 101 | completeCallback = params.completeCallback; |
diff --git src/wp-includes/customize/class-wp-customize-media-control.php src/wp-includes/customize/class-wp-customize-media-control.php
index bcd8db8..f066c02 100644
|
|
class WP_Customize_Media_Control extends WP_Customize_Control { |
196 | 196 | <div class="actions"> |
197 | 197 | <# if ( data.canUpload ) { #> |
198 | 198 | <button type="button" class="button remove-button">{{ data.button_labels.remove }}</button> |
199 | | <button type="button" class="button upload-button" id="{{ data.settings['default'] }}-button">{{ data.button_labels.change }}</button> |
| 199 | <button type="button" class="button upload-button control-focus" id="{{ data.settings['default'] }}-button">{{ data.button_labels.change }}</button> |
200 | 200 | <div style="clear:both"></div> |
201 | 201 | <# } #> |
202 | 202 | </div> |