From 241523dc74e2f0ae75d88f9100b9bf2e1cf61eab Mon Sep 17 00:00:00 2001 From: Siddharth Kshetrapal Date: Thu, 30 Jun 2022 17:51:11 +0530 Subject: [PATCH 1/3] Revert "remove tabIndex from AnchoredOverlay" This reverts commit e7f2d03df8d40364270c1af750b86f0941238dbe. --- src/AnchoredOverlay/AnchoredOverlay.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/AnchoredOverlay/AnchoredOverlay.tsx b/src/AnchoredOverlay/AnchoredOverlay.tsx index 6cdc8a10452..49ca88c79b3 100644 --- a/src/AnchoredOverlay/AnchoredOverlay.tsx +++ b/src/AnchoredOverlay/AnchoredOverlay.tsx @@ -166,6 +166,7 @@ export const AnchoredOverlay: React.FC = ({ id: anchorId, 'aria-haspopup': 'true', 'aria-expanded': open ? 'true' : undefined, + tabIndex: 0, onClick: onAnchorClick, onKeyDown: onAnchorKeyDown })} From 2f027b2777d92345231d929bc6a2f40256150155 Mon Sep 17 00:00:00 2001 From: Siddharth Kshetrapal Date: Thu, 30 Jun 2022 17:52:06 +0530 Subject: [PATCH 2/3] remove change from changelog as well --- .changeset/anchored-overlay-clever-mails-roll.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.changeset/anchored-overlay-clever-mails-roll.md b/.changeset/anchored-overlay-clever-mails-roll.md index 4db56e333ac..35a81944c2d 100644 --- a/.changeset/anchored-overlay-clever-mails-roll.md +++ b/.changeset/anchored-overlay-clever-mails-roll.md @@ -1,8 +1,5 @@ --- -"@primer/react": patch +'@primer/react': patch --- -AnchoredOverlay accessibility fixes -- `aria-expanded` attribute is removed from anchor when overlay is not open -- `tabIndex=0` is removed from anchor because it should only be used with interactive elements - +AnchoredOverlay: `aria-expanded` attribute is removed from anchor when overlay is not open From dbabe66c2be75a1f3289e51236c3607a6575e5ab Mon Sep 17 00:00:00 2001 From: Siddharth Kshetrapal Date: Thu, 30 Jun 2022 18:04:58 +0530 Subject: [PATCH 3/3] update matching snapshots --- src/__tests__/__snapshots__/ActionMenu.test.tsx.snap | 1 + src/__tests__/__snapshots__/AnchoredOverlay.test.tsx.snap | 2 ++ src/__tests__/__snapshots__/SelectPanel.test.tsx.snap | 1 + src/__tests__/deprecated/__snapshots__/ActionMenu.test.tsx.snap | 1 + .../deprecated/__snapshots__/DropdownMenu.test.tsx.snap | 1 + 5 files changed, 6 insertions(+) diff --git a/src/__tests__/__snapshots__/ActionMenu.test.tsx.snap b/src/__tests__/__snapshots__/ActionMenu.test.tsx.snap index 925a5d2db9e..0e9b4d3d76e 100644 --- a/src/__tests__/__snapshots__/ActionMenu.test.tsx.snap +++ b/src/__tests__/__snapshots__/ActionMenu.test.tsx.snap @@ -130,6 +130,7 @@ exports[`ActionMenu renders consistently 1`] = ` id="react-aria-1" onClick={[Function]} onKeyDown={[Function]} + tabIndex={0} type="button" > Anchor Button @@ -201,6 +202,7 @@ exports[`AnchoredOverlay should render consistently when open 1`] = ` aria-haspopup="true" class="c1" id="react-aria-1" + tabindex="0" > Anchor Button diff --git a/src/__tests__/__snapshots__/SelectPanel.test.tsx.snap b/src/__tests__/__snapshots__/SelectPanel.test.tsx.snap index 5447c83557e..6a30383ef8d 100644 --- a/src/__tests__/__snapshots__/SelectPanel.test.tsx.snap +++ b/src/__tests__/__snapshots__/SelectPanel.test.tsx.snap @@ -89,6 +89,7 @@ exports[`SelectPanel renders consistently 1`] = ` id="react-aria-1" onClick={[Function]} onKeyDown={[Function]} + tabIndex={0} type="button" > Select Items diff --git a/src/__tests__/deprecated/__snapshots__/ActionMenu.test.tsx.snap b/src/__tests__/deprecated/__snapshots__/ActionMenu.test.tsx.snap index 70b430b7144..ccd065a8243 100644 --- a/src/__tests__/deprecated/__snapshots__/ActionMenu.test.tsx.snap +++ b/src/__tests__/deprecated/__snapshots__/ActionMenu.test.tsx.snap @@ -74,5 +74,6 @@ exports[`ActionMenu renders consistently 1`] = ` id="react-aria-1" onClick={[Function]} onKeyDown={[Function]} + tabIndex={0} /> `; diff --git a/src/__tests__/deprecated/__snapshots__/DropdownMenu.test.tsx.snap b/src/__tests__/deprecated/__snapshots__/DropdownMenu.test.tsx.snap index 9666f15152e..dfcfe72cb7d 100644 --- a/src/__tests__/deprecated/__snapshots__/DropdownMenu.test.tsx.snap +++ b/src/__tests__/deprecated/__snapshots__/DropdownMenu.test.tsx.snap @@ -77,6 +77,7 @@ exports[`DropdownMenu renders consistently 1`] = ` id="react-aria-1" onClick={[Function]} onKeyDown={[Function]} + tabIndex={0} type="button" >