[wp-trac] [WordPress Trac] #33953: Chrome periodically does not redraw the admin panel after setPinMenu() is called

WordPress Trac noreply at wordpress.org
Mon Sep 21 23:08:42 UTC 2015


#33953: Chrome periodically does not redraw the admin panel after setPinMenu() is
called
----------------------------------------+-----------------------------
 Reporter:  deadduck169                 |      Owner:
     Type:  defect (bug)                |     Status:  new
 Priority:  normal                      |  Milestone:  Awaiting Review
Component:  General                     |    Version:  4.3.1
 Severity:  normal                      |   Keywords:
  Focuses:  javascript, administration  |
----------------------------------------+-----------------------------
 Note: This might actually be a Chromium bug, but the workaround is only 1
 line of code.

 The {{{setPinMenu()}}} function (located in wp-admin/js/common.js) adds
 and removes classes from the {{{body}}} element and for some reason Chrome
 45.0.2454.85 (64-bit) on Linux and Opera 32.0.1948.25, which both use
 Webkit sometimes fail to re-render the menu after this function is called.
 The error does not exist with Firefox. To reproduce, I usually just
 refresh and then click on the Dashboard link. It ends up looking like
 this:

 [[Image(http://i.imgur.com/rMd3Dlk.png)]]

 I have also attached a small screencast. Fortunately to fix this, just add
 the line

 {{{$body.hide().show(0);}}}

 to the end of {{{setPinMenu()}}}, which forces Chrome to redraw it. So it
 should look something like:

 {{{
     function setPinMenu() {
         resetHeights();

         if ( $adminmenu.data('wp-responsive') ) {
             $body.removeClass( 'sticky-menu' );
             unpinMenu();
         } else if ( height.menu + height.adminbar > height.window ) {
             pinMenu();
             $body.removeClass( 'sticky-menu' );
         } else {
             $body.addClass( 'sticky-menu' );
             unpinMenu();
         }
         $body.hide().show(0);
     }
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33953>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list