From 79ec4efd7d8a65e931dce6c6810d3b2e8152d336 Mon Sep 17 00:00:00 2001 From: Taylor Jones Date: Wed, 2 Mar 2022 15:29:25 -0600 Subject: [PATCH 1/2] fix(switcheritem): apply default tabindex before ...rest --- packages/react/src/components/UIShell/SwitcherItem.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react/src/components/UIShell/SwitcherItem.js b/packages/react/src/components/UIShell/SwitcherItem.js index 1a3f3b78d0f2..6a60514c61ed 100644 --- a/packages/react/src/components/UIShell/SwitcherItem.js +++ b/packages/react/src/components/UIShell/SwitcherItem.js @@ -39,10 +39,10 @@ const SwitcherItem = React.forwardRef(function SwitcherItem(props, ref) { return (
  • {children} From f163c5cef2ec246111b7c301f0bb2f5978cf45f2 Mon Sep 17 00:00:00 2001 From: Taylor Jones Date: Thu, 3 Mar 2022 16:24:45 -0600 Subject: [PATCH 2/2] fix(uishell): provide tabIndex as a named prop --- .../react/__tests__/__snapshots__/PublicAPI-test.js.snap | 6 ++++++ packages/react/src/components/UIShell/HeaderMenuItem.js | 8 +++++++- packages/react/src/components/UIShell/SwitcherItem.js | 8 +++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap index 848f7d0018f5..8fee794f5470 100644 --- a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap +++ b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap @@ -3354,6 +3354,9 @@ Map { "role": Object { "type": "string", }, + "tabIndex": Object { + "type": "number", + }, }, "render": [Function], }, @@ -6202,6 +6205,9 @@ Map { "className": Object { "type": "string", }, + "tabIndex": Object { + "type": "number", + }, }, "render": [Function], }, diff --git a/packages/react/src/components/UIShell/HeaderMenuItem.js b/packages/react/src/components/UIShell/HeaderMenuItem.js index 408f2f2b6642..aa82642ae65e 100644 --- a/packages/react/src/components/UIShell/HeaderMenuItem.js +++ b/packages/react/src/components/UIShell/HeaderMenuItem.js @@ -18,6 +18,7 @@ const HeaderMenuItem = React.forwardRef(function HeaderMenuItem( 'aria-current': ariaCurrent, children, role, + tabIndex = 0, ...rest }, ref @@ -38,7 +39,7 @@ const HeaderMenuItem = React.forwardRef(function HeaderMenuItem( aria-current={ariaCurrent} className={linkClassName} ref={ref} - tabIndex={0}> + tabIndex={tabIndex}> {children}
  • @@ -74,6 +75,11 @@ HeaderMenuItem.propTypes = { * `