From d3002106d573519bef274149c67dc94eca646c54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=A8?= Date: Tue, 22 Oct 2024 16:28:43 +0800 Subject: [PATCH] fix(a11y): false aria-hidden causes inconsistent behavior (#4074) --- framework/core/js/src/admin/components/UserListPage.tsx | 2 +- framework/core/js/src/common/components/ModalManager.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/core/js/src/admin/components/UserListPage.tsx b/framework/core/js/src/admin/components/UserListPage.tsx index e2b64583cf..7d934ccf15 100644 --- a/framework/core/js/src/admin/components/UserListPage.tsx +++ b/framework/core/js/src/admin/components/UserListPage.tsx @@ -318,7 +318,7 @@ export default class UserListPage extends AdminPage { ) ); - emailAddress.attr('aria-hidden', visible ? 'false' : 'true'); + emailAddress.attr('aria-hidden', visible ? null : 'true'); if (visible) { emailToggleButtonIcon.addClass('fa-eye'); diff --git a/framework/core/js/src/common/components/ModalManager.tsx b/framework/core/js/src/common/components/ModalManager.tsx index 498fa401dd..f2a46501fa 100644 --- a/framework/core/js/src/common/components/ModalManager.tsx +++ b/framework/core/js/src/common/components/ModalManager.tsx @@ -98,7 +98,7 @@ export default class ModalManager extends Component { // See: http://web-accessibility.carnegiemuseums.org/code/dialogs/ if (!this.attrs.state.isModalOpen()) { - document.getElementById('app')?.setAttribute('aria-hidden', 'false'); + document.getElementById('app')?.removeAttribute('aria-hidden'); this.focusTrap!.deactivate?.(); clearAllBodyScrollLocks();