Skip to content

Commit

Permalink
Navigation component: Fix item handling onClick twice (#33286)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-szabo97 authored and gwwar committed Jul 19, 2021
1 parent d40b5a1 commit b605256
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/components/src/navigation/item/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,15 @@ export default function NavigationItem( props ) {
onClick( event );
};
const icon = isRTL() ? chevronLeft : chevronRight;
const baseProps = isText
const baseProps = children ? props : { ...props, onClick: undefined };
const itemProps = isText
? restProps
: { as: Button, href, onClick: onItemClick, ...restProps };

return (
<NavigationItemBase { ...props } className={ classes }>
<NavigationItemBase { ...baseProps } className={ classes }>
{ children || (
<ItemUI { ...baseProps }>
<ItemUI { ...itemProps }>
<NavigationItemBaseContent
title={ title }
badge={ badge }
Expand Down

0 comments on commit b605256

Please sign in to comment.