From 163ac4cb4af4632495522e5a25709d1972e88be8 Mon Sep 17 00:00:00 2001 From: tellthemachines Date: Thu, 16 Dec 2021 20:23:10 +1100 Subject: [PATCH] Only add dialog role to navigation when modal is open. (#37434) --- .../src/navigation/edit/responsive-wrapper.js | 17 +++++++++------- .../block-library/src/navigation/index.php | 7 ++++--- packages/block-library/src/navigation/view.js | 20 ++++++++++++------- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/packages/block-library/src/navigation/edit/responsive-wrapper.js b/packages/block-library/src/navigation/edit/responsive-wrapper.js index b27d2b5247cc7..6c3df47b5f231 100644 --- a/packages/block-library/src/navigation/edit/responsive-wrapper.js +++ b/packages/block-library/src/navigation/edit/responsive-wrapper.js @@ -39,12 +39,20 @@ export default function ResponsiveWrapper( { const modalId = `${ id }-modal`; + const dialogProps = { + className: 'wp-block-navigation__responsive-dialog', + ...( isOpen && { + role: 'dialog', + 'aria-modal': true, + 'aria-label': __( 'Menu' ), + } ), + }; + return ( <> { ! isOpen && ( + '