Customize: Fix keyboard accessibility for toggling screen options and contextual help.

Also fix layout of search results in mobile.

Props valendesigns, afercia, adamsilverstein.
Fixes #33184.


git-svn-id: https://develop.svn.wordpress.org/trunk@33617 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Weston Ruter
2015-08-14 21:22:57 +00:00
parent 6d5da327f5
commit a4bbc4454c
2 changed files with 27 additions and 3 deletions
+12 -2
View File
@@ -538,7 +538,12 @@
content = panelMeta.find( '.customize-panel-description' ),
options = $( '#screen-options-wrap' ),
button = panelMeta.find( '.customize-screen-options-toggle' );
button.on( 'click', function() {
button.on( 'click keydown', function( event ) {
if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
return;
}
event.preventDefault();
// Hide description
if ( content.not( ':hidden' ) ) {
content.slideUp( 'fast' );
@@ -561,7 +566,12 @@
} );
// Help toggle
help.on( 'click', function() {
help.on( 'click keydown', function( event ) {
if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
return;
}
event.preventDefault();
if ( 'true' === button.attr( 'aria-expanded' ) ) {
button.attr( 'aria-expanded', 'false' );
help.attr( 'aria-expanded', 'true' );