[wp-trac] [WordPress Trac] #21832: Weird CSS with a large submenu item in admin

WordPress Trac wp-trac at lists.automattic.com
Fri Sep 7 14:11:37 UTC 2012


#21832: Weird CSS with a large submenu item in admin
--------------------------+-----------------------------
 Reporter:  ericlewis     |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Menus         |    Version:  trunk
 Severity:  normal        |   Keywords:  has-patch
--------------------------+-----------------------------
 With a large menu (tons of submenu pages) positioned at the bottom of the
 menu bar in the admin, there is some unexpected CSS behavior.

 While on a submenu page (or the top-level menu page), on hover of the menu
 will move the submenu actually up over some of the rest of the menu items.
 (See screenshot)

 I've traced it to a hover bind function on menus, which doesn't check if
 the current submenu is already opened before adjusting its CSS. If the
 menu is already open, it should just be left alone.

 To reproduce, drop this code in.

 {{{
 add_action('admin_menu', 'register_custom_menu_page');

 function register_custom_menu_page() {
         add_menu_page('custom menu title', 'custom menu', 'add_users',
 'custompage', 'custom_page_callback', '', 101);
         for ( $i = 0; $i <= 15; $i++ )
                 add_submenu_page( 'custompage', 'My Custom Submenu Page '
 . $i, 'My Custom Submenu Page ' . $i, 'manage_options', 'my-custom-
 submenu-page-' . $i, 'custom_page_callback' );
 }

 function custom_page_callback() {
         echo '<h3>My Custom Page</h3>';

 }
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21832>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list