From 38e9d34c87440f23ae822a3b56bf7313dae54134 Mon Sep 17 00:00:00 2001 From: AK <144495202+AKnassa@users.noreply.github.com> Date: Sat, 1 Aug 2026 03:23:43 -0400 Subject: [PATCH] docs(react-examples): fix GroupedList example a11y The GroupedList 'custom header and footer' examples (V1 and V2) return role-less divs from onRenderHeader/onRenderFooter. Those land directly inside the role="treegrid" list, which only allows row and rowgroup children, so accessibility scanners flag aria-required-children and screen readers get a malformed grid. Give the custom header and footer the same semantics as the built-in GroupHeader row: role="row" with a role="gridcell" child, plus aria-level/setsize/posinset/expanded on the header (the props are already populated by both GroupedList versions). Visual output is unchanged - the added inner divs are unstyled. Verified: header/footer now carry row+gridcell semantics and axe aria-structure rules pass on the rendered example; the react-examples build (CI type gate) succeeds; lint and prettier clean. The built-in GroupFooterBase has the same flaw at component level - left for a follow-up since changing component DOM could affect consumers. Fixes #33765 --- .../GroupedList.Custom.Example.tsx | 35 +++++++++++++------ .../GroupedListV2.Custom.Example.tsx | 35 +++++++++++++------ 2 files changed, 48 insertions(+), 22 deletions(-) diff --git a/packages/react-examples/src/react/GroupedList/GroupedList.Custom.Example.tsx b/packages/react-examples/src/react/GroupedList/GroupedList.Custom.Example.tsx index b6788ac6874214..559863e6e6997b 100644 --- a/packages/react-examples/src/react/GroupedList/GroupedList.Custom.Example.tsx +++ b/packages/react-examples/src/react/GroupedList/GroupedList.Custom.Example.tsx @@ -36,16 +36,25 @@ const onRenderHeader = (props?: IGroupHeaderProps): JSXElement | null => { props.onToggleCollapse!(props.group!); }; return ( -