Skip to content

Commit 74c101b

Browse files
committed
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. git-svn-id: https://develop.svn.wordpress.org/trunk@60482 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 6ecdf0c commit 74c101b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/js/_enqueues/wp/customize/controls.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,6 +1615,7 @@
16151615
} else {
16161616
expand = function() {
16171617
section._animateChangeExpanded( function() {
1618+
backBtn.attr( 'tabindex', '0' );
16181619
backBtn.trigger( 'focus' );
16191620
content.css( 'top', '' );
16201621
container.scrollTop( 0 );
@@ -1660,7 +1661,7 @@
16601661
}
16611662
}
16621663
section._animateChangeExpanded( function() {
1663-
1664+
backBtn.attr( 'tabindex', '-1' );
16641665
sectionTitle.trigger( 'focus' );
16651666
content.css( 'top', '' );
16661667

@@ -2714,6 +2715,7 @@
27142715
} else {
27152716
expand = function() {
27162717
section._animateChangeExpanded( function() {
2718+
backBtn.attr( 'tabindex', '0' );
27172719
backBtn.trigger( 'focus' );
27182720
content.css( 'top', '' );
27192721
container.scrollTop( 0 );
@@ -2744,7 +2746,7 @@
27442746
}
27452747
}
27462748
section._animateChangeExpanded( function() {
2747-
2749+
backBtn.attr( 'tabindex', '-1' );
27482750
sectionTitle.trigger( 'focus' );
27492751
content.css( 'top', '' );
27502752

@@ -2964,6 +2966,7 @@
29642966
} );
29652967
} else {
29662968
panel._animateChangeExpanded( function() {
2969+
backBtn.attr( 'tabindex', '0' );
29672970
backBtn.trigger( 'focus' );
29682971
accordionSection.css( 'top', '' );
29692972
container.scrollTop( 0 );

0 commit comments

Comments
 (0)