From 176e1957417ecedecd17a19b7d09739dfa3042c2 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Sat, 6 May 2017 16:47:08 +0200 Subject: [PATCH] Block switcher a11y. --- editor/block-switcher/index.js | 11 ++++++++++- editor/block-switcher/style.scss | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/editor/block-switcher/index.js b/editor/block-switcher/index.js index 90723d1cdc1667..b23ed5acebc694 100644 --- a/editor/block-switcher/index.js +++ b/editor/block-switcher/index.js @@ -73,17 +73,26 @@ class BlockSwitcher extends wp.element.Component { className="editor-block-switcher__toggle" icon={ blockSettings.icon } onClick={ this.toggleMenu } + aria-haspopup="true" + aria-expanded={ this.state.open } + label={ wp.i18n.__( 'Change block content type' ) } >
{ this.state.open && -
+
{ allowedBlocks.map( ( { slug, title, icon } ) => ( { title } diff --git a/editor/block-switcher/style.scss b/editor/block-switcher/style.scss index 2e97f123c8fd54..e33937c15f0182 100644 --- a/editor/block-switcher/style.scss +++ b/editor/block-switcher/style.scss @@ -56,6 +56,7 @@ cursor: pointer; &:hover, + &:focus, &:not(:disabled):hover { color: $dark-gray-500; border-color: $dark-gray-500;