[wp-trac] [WordPress Trac] #34529: Customizer: wp.customizer.section(xxx).focus() resizing issue (WP 4.4 Beta 2)

WordPress Trac noreply at wordpress.org
Sat Oct 31 17:24:34 UTC 2015


#34529: Customizer: wp.customizer.section(xxx).focus() resizing issue (WP 4.4 Beta
2)
--------------------------+-----------------------------
 Reporter:  wpweaver      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Customize     |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 I experience 2 problems with wp.customizer.section(xxx).focus(), one that
 is new in 4.4.

 The problem is a bit hard to duplicate as it doesn't consistently
 manifest.

 I have a popup menu displayed when the Customizer is open that uses an
 'onclick' to call wp.customizer.section(sectionname).focus();

 This menu can be clicked when the Optimizer is opened to any level - top
 level list of panels, 2nd level list of sections, or 3rd level list of
 options.

 The goal is to directly open the desired 3rd level list of options for a
 given panel/section. These issues manifest when opening these 3rd level
 menus.

 1. The first problem is that sometimes (seems to depend if one is moving
 to another section/option on the same parent) the width on '.accordion-
 section.current-panel' is calculated incorrectly. It should always be 100%
 (which would be 300px for the default Customizer width), but will be
 calculated to a smaller value - 280px, if I recall correctly.) This
 problem occurs on BOTH 4.3.1 and 4.4 Beta 2.

 2. As of WP 4.4 Beta 2, there is an additional issue with the top margin
 calculation for '.accordion-section-content.' When the section/options tab
 is displayed, it normally has a top margin of 0 (as it works on 4.3.1).
 But on 4.4, sometimes the top margin is 90px instead of 0.

 My current workaround for both of these issues is handled in the script:



 {{{
         jQuery('.accordion-section.current-panel').css('width','300px');
 // hack for Customizer's bad width calculation

         wp.customize.section(optionPanel).focus();

         jQuery(".accordion-section-content").css('margin-top','0px');
 // hack for WP 4.4 customizer bad top margin
 }}}


 If needed, I can provide a copy of my theme that demonstrates this issue.

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


More information about the wp-trac mailing list