Make WordPress Core

Changeset 60482


Ignore:
Timestamp:
07/18/2025 03:09:49 AM (6 months ago)
Author:
joedolson
Message:

Customize: Fix keyboard a11y on back button.

Following [59224], the back button for section navigation was no longer keyboard navigable. This was caused by an accidental removal of scripts that conditionally handled the tabindex value of this control to make it focusable only when visible.

Fixes the issue by restoring code removed in [59224].

Props wildworks, poojapadamad, abcd95, ankitmaru, iamshashank, sourabhjain, joedolson.
Fixes #63011.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/wp/customize/controls.js

    r59555 r60482  
    16161616                    expand = function() {
    16171617                        section._animateChangeExpanded( function() {
     1618                            backBtn.attr( 'tabindex', '0' );
    16181619                            backBtn.trigger( 'focus' );
    16191620                            content.css( 'top', '' );
     
    16611662                }
    16621663                section._animateChangeExpanded( function() {
    1663 
     1664                    backBtn.attr( 'tabindex', '-1' );
    16641665                    sectionTitle.trigger( 'focus' );
    16651666                    content.css( 'top', '' );
     
    27152716                    expand = function() {
    27162717                        section._animateChangeExpanded( function() {
     2718                            backBtn.attr( 'tabindex', '0' );
    27172719                            backBtn.trigger( 'focus' );
    27182720                            content.css( 'top', '' );
     
    27452747                }
    27462748                section._animateChangeExpanded( function() {
    2747 
     2749                    backBtn.attr( 'tabindex', '-1' );
    27482750                    sectionTitle.trigger( 'focus' );
    27492751                    content.css( 'top', '' );
     
    29652967                } else {
    29662968                    panel._animateChangeExpanded( function() {
     2969                        backBtn.attr( 'tabindex', '0' );
    29672970                        backBtn.trigger( 'focus' );
    29682971                        accordionSection.css( 'top', '' );
Note: See TracChangeset for help on using the changeset viewer.