[wp-trac] [WordPress Trac] #63042: Customizer accordion sections do not respond to click

WordPress Trac noreply at wordpress.org
Sun Mar 2 01:31:54 UTC 2025


#63042: Customizer accordion sections do not respond to click
----------------------------------------+-----------------------------
 Reporter:  joyously                    |      Owner:  (none)
     Type:  defect (bug)                |     Status:  new
 Priority:  normal                      |  Milestone:  Awaiting Review
Component:  Customize                   |    Version:
 Severity:  normal                      |   Keywords:
  Focuses:  javascript, administration  |
----------------------------------------+-----------------------------
 I last updated my theme in Oct. 2022, so it now has the 2 year warning on
 it. In order to test with the latest WP, I fired it up at
 https://wpsandbox.net/create/ and specifying the theme directly from the
 repository: https://wordpress.org/themes/twenty8teen/ .
 The front end works great, but this ticket is about some change that
 happened in the **wp-admin/js/accordion.js** which makes the theme's
 Customizer accordion not work.
 There is only one place to see it: install my theme and go to Customizer >
 Theme Advanced. **Clicking** on any of the presets in the list should open
 that section, but it does nothing.

 I have WP 6.4.5 locally, and it works there. I downloaded WP 6.6 to try,
 and it also fails. (Update: I tested it, but now notice it updated to
 6.7.2, which I didn't realize until after.)
 The following code is minimized, but I see that there is a difference
 between the working one and the failing one. It is the function from wp-
 admin/js/accordion.js that is attached to the click event on the div which
 is my control.
 From WP 6.4.5 (working) (and there is also a keydown event there)
 {{{
 function(e) {
   var n, o, a, i, t;
   "keydown" === e.type && 13 !== e.which || (e.preventDefault(), e = (e =
 s(this)).closest(".accordion-section"),
 n = e.find("[aria-expanded]").first(), o = e.closest(".accordion-
 container"),
 a = o.find(".open"), i = a.find("[aria-expanded]").first(),
 t = e.find(".accordion-section-content"), e.hasClass("cannot-expand")) ||
 (o.addClass("opening"), e.hasClass("open") ? (e.toggleClass("open"),
 t.toggle(!0).slideToggle(150)) : (i.attr("aria-expanded", "false"),
 a.removeClass("open"), a.find(".accordion-section-
 content").show().slideUp(150), t.toggle(!1).slideToggle(150),
 e.toggleClass("open")), setTimeout(function() {
     o.removeClass("opening")
   }, 150), n && n.attr("aria-expanded", String("false" === n.attr("aria-
 expanded"))))
 }
 }}}


 From WP 6.6 (failing) (and no keydown event)
 {{{
 function() {
   var n, o, e, a, t, i;
   n = s(this), o = n.closest(".accordion-section"), e = o.closest
 (".accordion-container"),
 a = e.find(".open"), t = a.find("[aria-expanded]").first(),
 i = o.find(".accordion-section-content"), o.hasClass("cannot-expand") ||
 (e.addClass("opening"), o.hasClass("open") ? (o.toggleClass("open"),
 i.toggle(!0).slideToggle(150)) : (t.attr("aria-expanded", "false"),
 a.removeClass("open"), a.find(".accordion-section-
 content").show().slideUp(150), i.toggle(!1).slideToggle(150),
 o.toggleClass("open")), setTimeout(function() {
     e.removeClass("opening")
   }, 150), n && n.attr("aria-expanded", String("false" === n.attr("aria-
 expanded"))))
 }
 }}}

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


More information about the wp-trac mailing list