[wp-trac] [WordPress Trac] #35947: Customizer panel fails to fully expand leaving extra margin

WordPress Trac noreply at wordpress.org
Thu Mar 10 20:01:03 UTC 2016


#35947: Customizer panel fails to fully expand leaving extra margin
-----------------------------------------+---------------------------
 Reporter:  tronoxas                     |       Owner:  ryankienstra
     Type:  defect (bug)                 |      Status:  assigned
 Priority:  normal                       |   Milestone:  4.5
Component:  Customize                    |     Version:  4.4.2
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch reporter-feedback  |     Focuses:
-----------------------------------------+---------------------------

Comment (by westonruter):

 @delawski @ryankienstra  I think the problem is that the `:visible` filter
 is applying before the panel/section is fully expanded. I can get the
 focus to apply for widgets and nav menu items if I tweak your patch with a
 delay:

 {{{#!diff
 --- src/wp-admin/js/customize-controls.js
 +++ src/wp-admin/js/customize-controls.js
 @@ -102,7 +102,9 @@
                 if ( params.completeCallback ) {
                         completeCallback = params.completeCallback;
                         params.completeCallback = function () {
 -                               focus();
 +                               setTimeout( function() {
 +                                       focus();
 +                               }, 500 );
                                 completeCallback();
                         };
                 } else {
 --- src/wp-admin/js/customize-nav-menus.js
 +++ src/wp-admin/js/customize-nav-menus.js
 @@ -1479,13 +1479,15 @@
                         params.completeCallback = function() {
                                 var focusable;

 -                               // Note that we can't use :focusable due
 to a jQuery UI issue. See: https://github.com/jquery/jquery-ui/pull/1583
 -                               focusable = control.container.find(
 '.menu-item-settings' ).find( 'input, select, textarea, button, object,
 a[href], [tabindex]' ).filter( ':visible' );
 -                               focusable.first().focus();
 +                               setTimeout( function() {
 +                                       // Note that we can't use
 :focusable due to a jQuery UI issue. See: https://github.com/jquery
 /jquery-ui/pull/1583
 +                                       focusable =
 control.container.find( '.menu-item-settings' ).find( 'input, select,
 textarea, button, object, a[href], [tabindex]' ).filter( ':visible' );
 +                                       focusable.first().focus();

 -                               if ( originalCompleteCallback ) {
 -                                       originalCompleteCallback();
 -                               }
 +                                       if ( originalCompleteCallback ) {
 +
 originalCompleteCallback();
 +                                       }
 +                               }, 500);
                         };

                         control.expandForm( params );

 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35947#comment:20>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list