From c3cb39da649a509f75c0f36d7ab12c42ff171831 Mon Sep 17 00:00:00 2001 From: Jorge Costa Date: Wed, 23 Aug 2023 10:17:50 +0100 Subject: [PATCH] [a11y] Fix: aria-haspop and aria-expanded attributes on the inserter button. (#53692) --- packages/edit-post/src/components/header/header-toolbar/index.js | 1 + packages/edit-site/src/components/header-edit-mode/index.js | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/edit-post/src/components/header/header-toolbar/index.js b/packages/edit-post/src/components/header/header-toolbar/index.js index 4e56e7ad8a9902..840067e9fb9b3d 100644 --- a/packages/edit-post/src/components/header/header-toolbar/index.js +++ b/packages/edit-post/src/components/header/header-toolbar/index.js @@ -149,6 +149,7 @@ function HeaderToolbar() { icon={ plus } label={ showIconLabels ? shortLabel : longLabel } showTooltip={ ! showIconLabels } + aria-expanded={ isInserterOpened } /> { ( isWideViewport || ! showIconLabels ) && ( <> diff --git a/packages/edit-site/src/components/header-edit-mode/index.js b/packages/edit-site/src/components/header-edit-mode/index.js index 63e0c2871f21e4..23b7adc1bc757c 100644 --- a/packages/edit-site/src/components/header-edit-mode/index.js +++ b/packages/edit-site/src/components/header-edit-mode/index.js @@ -216,6 +216,7 @@ export default function HeaderEditMode() { showIconLabels ? shortLabel : longLabel } showTooltip={ ! showIconLabels } + aria-expanded={ isInserterOpen } /> ) } { isLargeViewport && (