From c97f1841ba0e350b46d31ce8b2a601c2bfc0c51c Mon Sep 17 00:00:00 2001 From: Andrew Nguyen <52666982+Andrewnt219@users.noreply.github.com> Date: Sun, 14 Nov 2021 23:44:59 -0500 Subject: [PATCH 1/3] fix(devtools): improve devtools container a11y default element changes to aside from footer because aside represents a portion of a document whose content is only indirectly related to the document's main content. aria-label is also added to replace the text "generic" in a11y tree. --- src/devtools/devtools.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/devtools/devtools.tsx b/src/devtools/devtools.tsx index af098e5978..22544eaf1c 100644 --- a/src/devtools/devtools.tsx +++ b/src/devtools/devtools.tsx @@ -55,7 +55,7 @@ interface DevtoolsOptions { /** * Use this to render the devtools inside a different type of container element for a11y purposes. * Any string which corresponds to a valid intrinsic JSX element is allowed. - * Defaults to 'footer'. + * Defaults to 'aside'. */ containerElement?: string | any } @@ -91,7 +91,7 @@ export function ReactQueryDevtools({ closeButtonProps = {}, toggleButtonProps = {}, position = 'bottom-left', - containerElement: Container = 'footer', + containerElement: Container = 'aside', }: DevtoolsOptions): React.ReactElement | null { const rootRef = React.useRef(null) const panelRef = React.useRef(null) @@ -221,7 +221,11 @@ export function ReactQueryDevtools({ if (!isMounted()) return null return ( - + Date: Mon, 15 Nov 2021 00:27:10 -0500 Subject: [PATCH 2/3] fix(devtools): add aria to devtools toggle button aria-expanded indicates open/closed of the menu aria-haspopup indicates this is a menu button aria-controls to link to the menu, also added aria-label on the menu to label it. Read more: https://www.w3.org/TR/wai-aria-practices/examples/menu-button/menu-button-links.html --- src/devtools/devtools.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/devtools/devtools.tsx b/src/devtools/devtools.tsx index 22544eaf1c..75961471c3 100644 --- a/src/devtools/devtools.tsx +++ b/src/devtools/devtools.tsx @@ -269,6 +269,9 @@ export function ReactQueryDevtools({