Skip to content

Commit

Permalink
fix: added rel prop in switcher item (#17059)
Browse files Browse the repository at this point in the history
  • Loading branch information
riddhybansal authored Aug 9, 2024
1 parent d9c9b44 commit e3a8267
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7727,6 +7727,9 @@ Map {
"onKeyDown": Object {
"type": "func",
},
"rel": Object {
"type": "string",
},
"tabIndex": Object {
"type": "number",
},
Expand Down
10 changes: 10 additions & 0 deletions packages/react/src/components/UIShell/SwitcherItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ interface BaseSwitcherItemProps {
* Specify where to open the link.
*/
target?: HTMLAttributeAnchorTarget;
/**
* The rel property for the link.
*/
rel?: string;
}

interface SwitcherItemWithAriaLabel extends BaseSwitcherItemProps {
Expand Down Expand Up @@ -89,6 +93,7 @@ const SwitcherItem = forwardRef<ElementType, SwitcherItemProps>(
onKeyDown = () => {},
href,
target,
rel,
...rest
} = props;

Expand Down Expand Up @@ -132,6 +137,7 @@ const SwitcherItem = forwardRef<ElementType, SwitcherItemProps>(
}}
href={href}
target={target}
rel={rel}
ref={forwardRef}
{...rest}
className={linkClassName}
Expand Down Expand Up @@ -183,6 +189,10 @@ SwitcherItem.propTypes = {
* Specify where to open the link.
*/
target: PropTypes.string,
/**
* The rel property for the link.
*/
rel: PropTypes.string,
};

export default SwitcherItem;

0 comments on commit e3a8267

Please sign in to comment.